mirror of
https://github.com/barthuijgen/factorio-sites.git
synced 2025-01-20 11:34:44 +02:00
40 lines
1.6 KiB
YAML
40 lines
1.6 KiB
YAML
name: Deploy prd
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
environment: blueprints-prd
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
cache: "yarn"
|
|
- run: yarn
|
|
- run: yarn nx build blueprints
|
|
env:
|
|
PUBLIC_URL: https://factorio-blueprints-assets.storage.googleapis.com/public
|
|
CF_WEB_ANALYTICS: 4a7b06ea5bdb4d328a1baea602aea295
|
|
- name: Authenticate gcloud
|
|
uses: google-github-actions/auth@v1
|
|
with:
|
|
credentials_json: "${{ secrets.GCP_SA_KEY }}"
|
|
- name: Set up Cloud SDK
|
|
uses: google-github-actions/setup-gcloud@v1
|
|
- run: gcloud auth configure-docker --quiet
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: blueprints.github.Dockerfile
|
|
push: true
|
|
tags: eu.gcr.io/factorio-sites/blueprints
|
|
- run: gsutil -h "Cache-Control:public, max-age=31536000" -m rsync -r -d ./dist/apps/blueprints/.next/static gs://factorio-blueprints-assets/_next/static
|
|
- run: gsutil -h "Cache-Control:public, max-age=31536000" -m rsync -r -d ./dist/apps/blueprints/public gs://factorio-blueprints-assets/public
|
|
- run: gcloud run deploy factorio-blueprints --image=eu.gcr.io/factorio-sites/blueprints --platform managed --region=europe-west4 --update-env-vars PUBLIC_URL=https://factorio-blueprints-assets.storage.googleapis.com/public,ASSET_PREFIX=https://factorio-blueprints-assets.storage.googleapis.com,CF_WEB_ANALYTICS=4a7b06ea5bdb4d328a1baea602aea295
|