Change delay to two seconds #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Run tests | |
run: go test -race ./... | |
build: | |
runs-on: ubuntu-latest | |
needs: [ test ] | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: "${{ vars.GCP_WORKLOAD_IDENTITY_POOL_ID }}" | |
service_account: "${{ vars.GCP_SERVICE_ACCOUNT }}" | |
- uses: google-github-actions/setup-gcloud@v2 | |
- name: build | |
run: | | |
gcloud builds submit --pack image=gcr.io/${{ vars.GCP_PROJECT_ID }}/streaming-html/app:${{ github.sha }},builder=gcr.io/buildpacks/builder:google-22,env=GOOGLE_BUILDABLE=cmd/app/app.go | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: "${{ vars.GCP_WORKLOAD_IDENTITY_POOL_ID }}" | |
service_account: "${{ vars.GCP_SERVICE_ACCOUNT }}" | |
- uses: google-github-actions/setup-gcloud@v2 | |
- name: deploy | |
run: |- | |
gcloud run deploy streaming-html-app \ | |
--image gcr.io/${{ vars.GCP_PROJECT_ID }}/streaming-html/app:${{ github.sha }} \ | |
--region us-central1 \ | |
--allow-unauthenticated \ | |
--platform managed |