forked from semaphoreci-demos/semaphore-demo-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient-deploy.yml
36 lines (34 loc) · 1.32 KB
/
client-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This pipeline runs after semaphore.yml
version: v1.0
name: Client deploy
agent:
machine:
# Use a machine type with more RAM and CPU power for faster container
# builds:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Build
task:
# Set environment variables that your project requires.
# See https://docs.semaphoreci.com/article/66-environment-variables-and-secrets
env_vars:
- name: BUCKET_NAME
value: YOUR_APP_URL
# For info on creating secrets, see:
# https://docs.semaphoreci.com/article/66-environment-variables-and-secrets
secrets:
- name: gcr-secret
jobs:
- name: Deploy to Google Cloud Storage
commands:
# Authenticate using the file injected from the secret
- gcloud auth activate-service-account --key-file=.secrets.gcp.json
- gcloud config set project $GCP_PROJECT_ID
- gcloud config set compute/zone $GCP_PROJECT_DEFAULT_ZONE
# Restore build from cache.
- cache restore client-build-$SEMAPHORE_WORKFLOW_ID
# Deploy to Google Cloud Storage
- gsutil -m rsync -r build gs://$BUCKET_NAME
- gsutil iam ch allUsers:objectViewer gs://$BUCKET_NAME
- gsutil web set -m index.html -e 404.html gs://$BUCKET_NAME