From 7fc42e251b98bebb9e672bda5f04d89d3ec75a67 Mon Sep 17 00:00:00 2001 From: Will G Date: Sun, 26 Nov 2023 22:13:15 -0500 Subject: [PATCH] Fix github action --- .../{production.yml => production_push.yml} | 17 ++++------- .github/workflows/release_created.yml | 29 +++++++++++++++++++ .../{staging.yml => staging_push.yml} | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) rename .github/workflows/{production.yml => production_push.yml} (52%) create mode 100644 .github/workflows/release_created.yml rename .github/workflows/{staging.yml => staging_push.yml} (97%) diff --git a/.github/workflows/production.yml b/.github/workflows/production_push.yml similarity index 52% rename from .github/workflows/production.yml rename to .github/workflows/production_push.yml index e1d4725..8414bce 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production_push.yml @@ -1,12 +1,9 @@ -name: Production +name: Production Push on: push: branches: - 'production' - release: - types: - - created jobs: docker: @@ -25,10 +22,8 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push latest - if: github.event_name == 'push' - run: docker/build-push-action@v5 --push --tag runbooksolutions/agent:latest . - - - name: Build and push tag - if: github.event_name == 'release' && github.ref - run: docker/build-push-action@v5 --push --tag runbooksolutions/agent:${{ github.event.release.tag_name }} . + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: runbooksolutions/agent:latest diff --git a/.github/workflows/release_created.yml b/.github/workflows/release_created.yml new file mode 100644 index 0000000..13ccdc2 --- /dev/null +++ b/.github/workflows/release_created.yml @@ -0,0 +1,29 @@ +name: Release Created + +on: + release: + types: + - created + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: runbooksolutions/agent:latest, runbooksolutions/agent:${{ github.event.release.tag_name }} diff --git a/.github/workflows/staging.yml b/.github/workflows/staging_push.yml similarity index 97% rename from .github/workflows/staging.yml rename to .github/workflows/staging_push.yml index c083533..218b298 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging_push.yml @@ -1,4 +1,4 @@ -name: Dev +name: Staging Push on: push: