v4.2.0 #45
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: CI | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: bot | |
REPOSITORY: rowifi | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: auth | |
uses: google-github-actions/auth@v0 | |
with: | |
credentials_json: ${{ secrets.GOOGLE_SERVICE_KEY }} | |
- name: Setup GCP SDK | |
uses: google-github-actions/[email protected] | |
- name: Configure Docker Client | |
shell: bash | |
run: gcloud --quiet auth configure-docker ${{ secrets.REGISTRY }} | |
- name: Build Docker Image | |
shell: bash | |
run: docker build -t ${{ env.IMAGE_NAME }}:latest --build-arg GITHUB_PAT=${{ secrets.GH_PAT }} . | |
- name: Push Docker Image to Artifact Registry | |
shell: bash | |
run: |- | |
docker tag ${{ env.IMAGE_NAME }}:latest ${{ secrets.REGISTRY }}/${{ secrets.GOOGLE_PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:latest | |
docker tag ${{ env.IMAGE_NAME }}:latest ${{ secrets.REGISTRY }}/${{ secrets.GOOGLE_PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:$GITHUB_SHA | |
docker push ${{ secrets.REGISTRY }}/${{ secrets.GOOGLE_PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:latest | |
docker push ${{ secrets.REGISTRY }}/${{ secrets.GOOGLE_PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:$GITHUB_SHA |