name: build and push Docker image on: push: tags: - "release_[0-9]+" jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: version: '270.0.0' service_account_email: ${{ secrets.GCP_STG_EMAIL }} service_account_key: ${{ secrets.GCP_STG_PRIVATE_KEY }} export_default_credentials: true - name: Configure GCR Docker auth (stg) run: gcloud auth configure-docker - name: Build docker image run: docker build --tag ml-agents:${GITHUB_SHA} --build-arg SHA=${GITHUB_SHA} . - name: Tag docker image (stg) run: | docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-stg/ml-agents:${GITHUB_SHA} docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-stg/ml-agents:latest - name: Push docker image (stg) run: | docker push gcr.io/unity-ai-ml-agents-stg/ml-agents:${GITHUB_SHA} docker push gcr.io/unity-ai-ml-agents-stg/ml-agents:latest - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: version: '270.0.0' service_account_email: ${{ secrets.GCP_PRD_EMAIL }} service_account_key: ${{ secrets.GCP_PRD_PRIVATE_KEY }} export_default_credentials: true - name: Configure GCR Docker auth (prd) run: gcloud auth configure-docker - name: Tag docker image (prd) run: | docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-prd/ml-agents:${GITHUB_SHA} docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-prd/ml-agents:latest - name: Push docker image (prd) run: | docker push gcr.io/unity-ai-ml-agents-prd/ml-agents:${GITHUB_SHA} docker push gcr.io/unity-ai-ml-agents-prd/ml-agents:latest