diff --git a/.github/workflows/push_container.yaml b/.github/workflows/push_container.yaml new file mode 100644 index 0000000..8092a05 --- /dev/null +++ b/.github/workflows/push_container.yaml @@ -0,0 +1,43 @@ +name: Build and publish image +on: + release: + types: [published] + workflow_dispatch: + pull_request: + +jobs: + push_to_registry: + name: Build and push Docker image to GitHub Container Registry + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create tags for publishing image + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/dawn + tags: | + type=ref,event=tag + type=raw,value=latest + + - name: Build and push image to GitHub Packages + uses: docker/build-push-action@v6 + with: + context: . + file: ./releng/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}