Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Added CD for base templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Jun 12, 2020
1 parent 7e4863f commit 841a0aa
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/cd-staging-base-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Continuous Deployment base templates staging

on:
push:
branches:
- develop
paths:
- 'templates/**'

env:
GKE_CLUSTER: susbtrate-playground-staging
GKE_ZONE: us-central1-a
DOCKER_BUILDKIT: 1

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v2
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
# GCLOUD_KEY is the base64 of the gcloud service account JSON file
# Get the JSON file from https://console.cloud.google.com/iam-admin/serviceaccounts?authuser=1&hl=fr&project=substrateplayground-252112&folder=&organizationId=&supportedpurview=project
# ... -> Actions -> Create Key
# then base64 substrateplayground-XXX.json | tr -d \\n
service_account_key: ${{ secrets.GCLOUD_KEY }}
export_default_credentials: true
project_id: ${{ secrets.GKE_PROJECT }}
- run: gcloud --quiet auth configure-docker
- run: gcloud container clusters get-credentials "$GKE_CLUSTER" --zone "$GKE_ZONE"
- run: echo "::set-env name=ACCESS_TOKEN::$(gcloud auth print-access-token)"
- uses: docker/build-push-action@v1 # https://github.com/docker/build-push-action
with:
username: oauth2accesstoken
password: ${{ env.ACCESS_TOKEN }}
path: templates
dockerfile: templates/Dockerfile.base
repository: substrateplayground-252112/jeluard/substrate-playground-template-base
registry: gcr.io
tags: latest
add_git_labels: true
tag_with_ref: true
tag_with_sha: true
- uses: docker/build-push-action@v1
with:
username: oauth2accesstoken
password: ${{ env.ACCESS_TOKEN }}
path: frontend
dockerfile: frontend/Dockerfile
repository: substrateplayground-252112/jeluard/substrate-playground-template-theia-base
registry: gcr.io
tags: latest
add_git_labels: true
tag_with_ref: true
tag_with_sha: true
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.env.outputs.sha }}
release_name: ${{ steps.env.outputs.sha }}
body: |
Base templates release:
- jeluard/substrate-playground-template-base:${{ steps.env.outputs.sha }}
- jeluard/substrate-playground-template-theia-base:${{ steps.env.outputs.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 841a0aa

Please sign in to comment.