Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (47 sloc) 1.45 KB
name: CD
on:
push:
branches:
- master
schedule:
- cron: '20 0 * * WED'
# Environment variables available to all jobs and steps in this workflow
env:
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
GITHUB_SHA: ${{ github.sha }}
GKE_ZONE: us-east1-d
GKE_CLUSTER: main
IMAGE: docker.pkg.github.com/seriousben/club-canin-aylmer-members/site
DOCKER_USER: seriousben
DOCKER_PASS: ${{ secrets.github_token }}
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '272.0.0'
service_account_key: ${{ secrets.GKE_KEY }}
- name: Docker login
run: |
docker login docker.pkg.github.com -u $DOCKER_USER -p $DOCKER_PASS
- name: Docker build
run: |
docker build \
-t "$IMAGE":"$GITHUB_SHA" \
-t "$IMAGE":latest \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" \
.
- name: Docker push
run: |
docker push $IMAGE:latest
docker push $IMAGE:$GITHUB_SHA
- name: Deploy
run: |
gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
kubectl set image deployment/frontend frontend=$IMAGE:$GITHUB_SHA -n=club-canin-aylmer-members
You can’t perform that action at this time.