Build `main` Docker images on every push to `main` branch (#272)

This makes it possible to test latest `carton` Docker builds from the `main` branch.

* Attempt to push Docker image in `swift.yml`

* Update swift.yml

* Update swift.yml

* Push only a single tag

* Use secrets.PAT for GHCR login

* Move nightly tags to separate `docker.yml` workflow

* Rename `nightly` to `main`
This commit is contained in:
Max Desiatov 2022-01-05 11:43:15 +00:00 committed by GitHub
parent 0a28655e5c
commit b0d53c286a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

29
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Build main Docker image
on:
push:
branches: [main]
jobs:
docker:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Push Docker image
uses: docker/build-push-action@v2
with:
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:main