Skip to content

chore: test OPA build workflow with OPA SA #17

chore: test OPA build workflow with OPA SA

chore: test OPA build workflow with OPA SA #17

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_OPA_DEVELOPER }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Log in to 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:latest .
- name: Push Docker image to Docker Hub
run: |
docker push cdxvy30/opa-service:latest
- name: Deploy to Cloud Run
run: |
gcloud run deploy opa-service \
--image docker.io/cdxvy30/opa-service:latest \
--region ${{ secrets.GCP_REGION }} \
--platform managed \
--allow-unauthenticated