Updates Github Actions

Github Actions will now build on a PR.
Github Actions will now build and push an image to quay on a commit to
the main branch.
This commit is contained in:
Renán Del Valle 2021-11-23 20:09:44 -08:00
parent af535f2a5c
commit 57c8bdf570
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
2 changed files with 34 additions and 4 deletions

32
.github/workflows/create-push-image.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: Create Docker Images
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
name: Build and push to Quay
steps:
- uses: actions/checkout@v2
- name: Log into the container repository
run: |
docker login \
--username "${{ secrets.CONTAINER_REPO_USERNAME }}" \
--password "${{ secrets.CONTAINER_REPO_TOKEN }}" \
quay.io/katbox
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build
run: make
- name: Build all of the container images
run: |
docker build . --tag quay.io/katbox/driver:latest --no-cache
- name: Push the images
if: github.ref == 'refs/heads/main'
run: |
docker push quay.io/katbox/driver:latest

View file

@ -1,8 +1,6 @@
name: CI
name: Pull Request Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
@ -19,4 +17,4 @@ jobs:
go-version: 1.17
- name: Build
run: make
run: make