50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Push web base image
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
release:
|
|
types: [published, created, edited]
|
|
pull_request:
|
|
jobs:
|
|
push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
# list of Docker images to use as base name for tags
|
|
images: |
|
|
ghcr.io/${{ github.repository_owner }}/web-base
|
|
# generate Docker tags based on the following events/attributes
|
|
tags: |
|
|
type=semver,pattern={{row}}
|
|
type=sha
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Login to ghcr
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|