Does anyone have a deployment GitHub actions workf...
# ask-community
m
Does anyone have a deployment GitHub actions workflow that works with GCP Artifact Registry?
j
Hey @Matthew Bell Hope this helps 🙏 - I can give you a summary of what we use: 1. Checkout code 2. authenticate to Google Cloud with GCP Auth Action 3. Authenticate to GCP Artifact Registry with docker login action 4. Run a shell script that builds/pushes (probably don't have to do this in Shell script, could just do in GH Action. I Made it a shell so I can deploy locally when doing dev work.) a. docker build b. docker push
Copy code
artifact-registry-deployment:
    environment: ${{ inputs.environment }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
      - name: Get Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - name: Authenticate to Google Cloud
        uses: google-github-actions/auth@v2
        with:
          credentials_json: ${{ secrets.GCP_CREDENTIALS }}
      - name: Login to Artifact Registry
        uses: docker/login-action@v3
        with:
          registry: <region>-docker.pkg.dev
          username: _json_key
          password: ${{ secrets.GCP_CREDENTIALS }}
      - name: Build & Deploy Image/Deployments
        run: ./run helm:deploy-cicd