Skip to content

(ci/cd) GCS deployment #1

(ci/cd) GCS deployment

(ci/cd) GCS deployment #1

Workflow file for this run

name: Deploy to GCS
on:
push:
branches:
- main # Trigger on push to main branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18" # Ensure the correct Node.js version
- name: Install dependencies
working-directory: travian/frontend # Change to frontend directory
run: npm install
- name: Build project
working-directory: travian/frontend # Change to frontend directory
run: npm run build
- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Upload to GCS
run: |
gsutil -m rsync -r travian/frontend/dist gs://peillac.xyz # Correct path for the dist folder
- name: Make GCS objects public
run: gsutil iam ch allUsers:objectViewer gs://peillac.xyz