Skip to content

Merge pull request #45 from INTO-CPS-Association/5-view-or-edit-scala… #10

Merge pull request #45 from INTO-CPS-Association/5-view-or-edit-scala…

Merge pull request #45 from INTO-CPS-Association/5-view-or-edit-scala… #10

Workflow file for this run

name: GitWorks Workbench CI/CD
on:
push:
branches:
- main
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GAR_LOCATION: europe-west2
DEPLOYMENT_NAME: gke-gitworks-workbench
REPOSITORY: gitworks-workbench
IMAGE: gitworks-workbench
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install && npm ci && npm run package
- run: npm install -g @vscode/vsce
- run: vsce package
- name: Archive VSCode VSIX
uses: actions/upload-artifact@v3
with:
name: vscode-vsix
path: ./*.vsix
- run: docker build -t $GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA .
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GKE_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Docker configuration
run: |-
gcloud --quiet auth configure-docker $GAR_LOCATION-docker.pkg.dev
- id: 'get-credentials'
uses: 'google-github-actions/get-gke-credentials@v0'
with:
cluster_name: gitworks-workbench-autopilot-cluster
location: europe-west2
- name: Publish
run: |-
docker push "$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA"
- name: Set up Kustomize
run: |-
curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64
chmod u+x ./kustomize
- name: Deploy
run: |-
./kustomize edit set image LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG=$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA
./kustomize build . | kubectl apply -f -
kubectl rollout status deployment/$DEPLOYMENT_NAME
kubectl get services -o wide