Skip to content

update google github actions to v1 in staging #565

update google github actions to v1 in staging

update google github actions to v1 in staging #565

name: Deploy to staging
on:
workflow_run:
workflows: ["Test"]
branches:
- develop
types:
- completed
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: p5-gke-cluster
GKE_ZONE: us-east4
DEPLOYMENT_NAME: web-editor-node
IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor-staging
jobs:
push_to_registry:
environment: staging
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: |
${{ env.IMAGE }}:${{ github.sha }}
${{ env.IMAGE }}:latest
target: production
# Setup gcloud CLI
- id: auth
uses: google-github-actions/auth@v1
with:

Check failure on line 44 in .github/workflows/deploy-staging.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-staging.yml

Invalid workflow file

You have an error in your yaml syntax on line 44
credentials_json: ${{ secrets.GKE_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v1
# Configure docker to use the gcloud command-line tool as a credential helper
- run: |-
gcloud --quiet auth configure-docker
# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
# Deploy the Docker image to the GKE cluster
- name: Deploy
run: |-
kubectl set image deployment/$DEPLOYMENT_NAME web-editor-app=index.docker.io/$IMAGE:$GITHUB_SHA --namespace=staging
kubectl get services -o wide