girder_buckling: bug was not fixed by previous fix. sxsd could be neg… #3
This file contains hidden or 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: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "protobuf" ] | |
| env: | |
| SERVICE: bucklingapitest | |
| REGION: europe-west1 | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build the Docker image | |
| run: docker build . --file dockerfile --tag ${{env.REGION}}-docker.pkg.dev/${{secrets.GOOGLE_REPO_NAME}}/bucklingapitest/bucklingapiprotobuf:latest | |
| # END - Build the Docker image | |
| # from: https://github.com/google-github-actions/auth#setting-up-workload-identity-federation | |
| # I took the authentication via "Service Account Key JSON" because it is very similar to the CLI on a local machine | |
| # Had to enable the "IAM Service Account Credentials API" to allow to hand out short lived tokens. Can be found by searching for "Service Account Credentials API" in the console GUI | |
| # I had to add the container registry service account as a principle to itself with the "Service Account Token Creator" role, otherwise the service account was not permitted | |
| - id: 'auth' | |
| name: 'Authenticate to Google Cloud' | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| credentials_json: '${{ secrets.GOOGLE_ARTIFACTS_CREDENTIALS }}' | |
| token_format: 'access_token' | |
| # This example runs "docker login" directly to Container Registry. | |
| - run: |- | |
| echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://${{env.REGION}}-docker.pkg.dev | |
| - name: Docker push | |
| run: docker push ${{env.REGION}}-docker.pkg.dev/${{secrets.GOOGLE_REPO_NAME}}/bucklingapitest/bucklingapiprotobuf:latest | |
| # END - Auth and push docker container to google container registry | |
| deploy: | |
| needs: build | |
| name: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # from https://github.com/google-github-actions/deploy-cloudrun#credentials | |
| - id: 'authCloudRun' | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| credentials_json: '${{ secrets.GOOGLE_CLOUDRUN_CREDENTIALS }}' | |
| # docs: https://github.com/marketplace/actions/deploy-to-cloud-run | |
| - name: 'Deploy to Cloud Run' | |
| uses: 'google-github-actions/deploy-cloudrun@v2' | |
| with: | |
| image: '${{env.REGION}}-docker.pkg.dev/${{secrets.GOOGLE_REPO_NAME}}/bucklingapitest/bucklingapiprotobuf:latest' | |
| service: '${{env.SERVICE}}' | |
| region: '${{env.REGION}}' |