update to stockfish 17 #31
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 Deploy to Cloud Run | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PROJECT_ID: "${{secrets.GCP_PROJECT_ID}}" | |
GAR_LOCATION: "australia-southeast2" | |
REPOSITORY: "stockfish" | |
STOCKFISH_VERSION: "16" | |
SERVICE: "stockfish-chess-api" | |
REGION: "australia-southeast2" | |
jobs: | |
deploy: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Google Auth | |
id: auth | |
uses: "google-github-actions/auth@v0" | |
with: | |
credentials_json: "${{ secrets.GCP_ACCOUNT_SERVICE }}" | |
# - name: Docker Auth | |
# id: docker-auth | |
# uses: 'docker/login-action@v2' | |
# with: | |
# username: 'oauth2accesstoken' | |
# password: '${{ steps.auth.outputs.access_token }}' | |
# registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' | |
- name: Docker Auth | |
id: docker-auth | |
uses: "docker/login-action@v2" | |
with: | |
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GCP_ACCOUNT_SERVICE }} | |
- name: Build and Push Container | |
run: |- | |
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" --build-arg VERSION=$STOCKFISH_VERSION ./ | |
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" | |
# END - Docker auth and build | |
- name: Deploy to Cloud Run | |
id: deploy | |
uses: google-github-actions/deploy-cloudrun@v0 | |
with: | |
service: ${{ env.SERVICE }} | |
region: ${{ env.REGION }} | |
# NOTE: If using a pre-built image, update the image name here | |
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} | |
flags: "--allow-unauthenticated --cpu=2 --memory=4Gi" | |
# If required, use the Cloud Run url output in later steps | |
- name: Show Output | |
run: echo ${{ steps.deploy.outputs.url }} |