diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index be30b34..ada35c9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,6 +9,9 @@ on: types: - published +permissions: + contents: read + jobs: source: name: Source @@ -105,3 +108,46 @@ jobs: - name: Build run: | make + docker: + name: Docker + runs-on: ubuntu-20.04 + permissions: + packages: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - name: Prepare QEMU + uses: docker/setup-qemu-action@v3 + - name: Prepare Buildx + uses: docker/setup-buildx-action@v3 + - name: Login GitHub Packages Docker Image Repository + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Format Docker Image Meta + uses: docker/metadata-action@v5 + id: docker_meta + with: + images: ghcr.io/${{ github.repository_owner }}/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=nightly,enable={{is_default_branch}} + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6,linux/riscv64 + push: ${{ github.event_name != 'pull_request' }} + provenance: false + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }}