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 }}