Skip to content

chore: test OPA build workflow #6

chore: test OPA build workflow

chore: test OPA build workflow #6

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: Configure Docker
run: gcloud auth configure-docker
- 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