Skip to content

chore: test OPA build workflow with update SA key #8

chore: test OPA build workflow with update SA key

chore: test OPA build workflow with update SA key #8

Workflow file for this run

name: OPA Service CI/CD
on:
push:
branches:
- 'infra'
# paths:
# - 'opa-service/**'
jobs:
build-and-deploy-opa:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Google Cloud Auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Login Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: |
cd opa-service
docker build -t cdxvy30/opa-service:${{ github.sha }} .
- name: Push Docker image to Docker Hub
run: |
docker push cdxvy30/opa-service:${{ github.sha }}
- name: Deploy to Cloud Run
run: |
gcloud run deploy opa-service \
--image docker.io/cdxvy30/opa-service:${{ github.sha }} \
--region ${{ secrets.GCP_REGION }} \
--platform managed \
--allow-unauthenticated