Skip to content

updat env_explorer

updat env_explorer #51

Workflow file for this run

name: Build and publish a Docker image
on:
push:
branches:
- "main"
tags: [ '*' ]
# - 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ main ]
jobs:
build:
name: Build & push docker image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./example-1-sidecars
image: ghcr.io/liquid-reply/k8s-spin/spin-static-server
- dockerfile: ./example-2-redis
image: ghcr.io/liquid-reply/k8s-spin/spin-redis
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Debug
run: |
echo "github.ref -> {{ github.ref }}"
- # Login into registry
name: Login to GitHub Container Registry
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- # Extract Docker metadata
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- # Build and push to GHCR Registry
name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
file: ${{ matrix.dockerfile }}/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ matrix.image }}:latest
${{ steps.meta.outputs.tags }}