From cd34b5277b863d30c1102e1d8db2a231a4d6a2a9 Mon Sep 17 00:00:00 2001 From: Ian Rose Date: Fri, 10 Nov 2023 12:34:41 -0500 Subject: [PATCH] merge steps --- .github/workflows/go.yml | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e50b30f..213f83b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: [push] jobs: - build: + build-and-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -23,24 +23,18 @@ jobs: - name: Test run: go test ./... - push: - runs-on: ubuntu-latest - needs: [build] - steps: - - uses: actions/checkout@v4 - - - name: Setup - run: mkdir -p bin/linux && cp bin/webapp bib/linux_amd64/webapp - - - name: Get shortsha - id: vars - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Push to GCR - uses: RafikFarhad/push-to-gcr-github-action@v4.1 - with: - gcloud_service_key: ${{ secrets.GCP_SERVICE_ACCOUNT }} - registry: gcr.io - project_id: ian-rose - image_name: us-central1-docker.pkg.dev/ian-rose/docker-1/webapp - image_tag: latest,${{ steps.vars.outputs.sha_short }} + - name: Setup + run: mkdir -p bin/linux && cp bin/webapp bib/linux_amd64/webapp + + - name: Get shortsha + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Push to GCR + uses: RafikFarhad/push-to-gcr-github-action@v4.1 + with: + gcloud_service_key: ${{ secrets.GCP_SERVICE_ACCOUNT }} + registry: gcr.io + project_id: ian-rose + image_name: us-central1-docker.pkg.dev/ian-rose/docker-1/webapp + image_tag: latest,${{ steps.vars.outputs.sha_short }}