From 57c8bdf570143d793d6f7a46460263c71ef03732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A1n=20Del=20Valle?= Date: Tue, 23 Nov 2021 20:09:44 -0800 Subject: [PATCH] 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. --- .github/workflows/create-push-image.yml | 32 +++++++++++++++++++++++++ .github/workflows/{ci.yml => pr.yml} | 6 ++--- 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/create-push-image.yml rename .github/workflows/{ci.yml => pr.yml} (81%) diff --git a/.github/workflows/create-push-image.yml b/.github/workflows/create-push-image.yml new file mode 100644 index 0000000..643cc2a --- /dev/null +++ b/.github/workflows/create-push-image.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/pr.yml similarity index 81% rename from .github/workflows/ci.yml rename to .github/workflows/pr.yml index 86a62dc..498be93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/pr.yml @@ -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 \ No newline at end of file