This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
fix to getenv #89
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 and Push Bot | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: Convert repository name | |
id: convert-repo-name | |
run: | | |
REPO_NAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]-') | |
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_OUTPUT | |
- id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: access_token | |
workload_identity_provider: 'projects/979321260256/locations/global/workloadIdentityPools/github/providers/github' | |
service_account: '${{ steps.convert-repo-name.outputs.REPO_NAME }}@pokerai-417521.iam.gserviceaccount.com' | |
access_token_lifetime: 300s | |
- name: Login to Artifact Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: us-east4-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- name: Get tag | |
id: get-tag | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- id: docker-push-tagged | |
name: Tag Docker image and push to Google Artifact Registry | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: | | |
us-east4-docker.pkg.dev/pokerai-417521/${{ steps.convert-repo-name.outputs.REPO_NAME }}/pokerbot:${{ steps.get-tag.outputs.short_ref }} | |
us-east4-docker.pkg.dev/pokerai-417521/${{ steps.convert-repo-name.outputs.REPO_NAME }}/pokerbot:latest | |
file: dockerfiles/python_skeleton/Dockerfile |