wg-easy-extended/.github/workflows/build.yml
renovate[bot] fb9b387534
Update docker/login-action action to v2.1.0 (#11)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-23 03:05:29 +07:00

53 lines
1.4 KiB
YAML

name: Build
on:
pull_request:
branches:
- "*"
push:
tags:
- "v[0-9].*.*"
jobs:
build:
runs-on: ubuntu-latest
name: Build image
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v3
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v2
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: 🪄 Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: 🔓 Registry login
if: github.event_name == 'push'
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Build image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name == 'push' }}