From 4b62b86b99555d3653967d77b59998264d737b04 Mon Sep 17 00:00:00 2001 From: Nikita Sokovnin <49622375+sokovninn@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:58:03 +0200 Subject: [PATCH] chore: create gar-publish-dev.yaml --- .github/workflows/gar-publish-dev.yaml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/gar-publish-dev.yaml diff --git a/.github/workflows/gar-publish-dev.yaml b/.github/workflows/gar-publish-dev.yaml new file mode 100644 index 0000000..8693392 --- /dev/null +++ b/.github/workflows/gar-publish-dev.yaml @@ -0,0 +1,38 @@ +# Reference: https://gist.github.com/joeyslalom/3a3b4783ea9f2e7fa3493c13bcf68e0a + +name: Deploy dev image to GAR (Google Artifact Registry) + +on: + workflow_dispatch: +env: + PROJECT_ID: easyml-394818 + GAR_LOCATION: us-central1 + +jobs: + push-store: + name: Push the image to GAR + runs-on: ubuntu-latest + + steps: + - name: 'Checkout GitHub Action' + uses: actions/checkout@main + + - id: 'auth' + name: 'Authenticate to Google Cloud' + uses: 'google-github-actions/auth@v0.6.0' + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + token_format: 'access_token' + + - uses: 'docker/login-action@v1' + name: 'Docker login' + with: + registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' + username: 'oauth2accesstoken' + password: '${{ steps.auth.outputs.access_token }}' + + - name: 'Build Inventory Image' + working-directory: . + run: | + docker build --build-arg GITHUB_TOKEN=${{secrets.GHCR_PAT}} . --tag dev + docker push $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/datadreamer --all-tags