Skip to content

Commit

Permalink
Merge pull request #79 from alexarts74/master
Browse files Browse the repository at this point in the history
modifying workflow
  • Loading branch information
moufmouf authored May 27, 2024
2 parents 69bb661 + fc24ddb commit a5fb75f
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Optimize map and deploy

on: [ push ]
on: [push]

permissions:
contents: write
Expand All @@ -17,24 +17,40 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

- name: "Install dependencies"
run: npm install

- name: "Build scripts"
run: npm run build

- name: Deploy
- name: Use API key from secrets
env:
API_KEY: ${{ secrets.API_KEY }}
run: echo "API_KEY=${API_KEY}" >> $GITHUB_ENV

- name: Use URL Map STORAGE from secrets
env:
URL_MAP_STORAGE: ${{ secrets.URL_MAP_STORAGE }}
run: echo "URL_MAP_STORAGE=${URL_MAP_STORAGE}" >> $GITHUB_ENV

- name: Generate .env.secret
run: echo "API_KEY=${{ secrets.API_KEY }}" > .env.secret

- name: Extract UPLOAD_MODE from .env
run: echo "UPLOAD_MODE=$(grep UPLOAD_MODE .env | cut -d '=' -f2)" >> $GITHUB_ENV

- name: Deploy in MAP STORAGE
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
run: npx @workadventure/upload-maps upload.js

- name: Deploy on GITHUB PAGES
if: ${{ env.UPLOAD_MODE == 'GH_PAGES' }}
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.ref == 'refs/heads/master'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist/ # The folder the action should deploy.
BRANCH: gh-pages
FOLDER: dist/
BASE_BRANCH: master

- name: Bash2
run: |
ls -al

0 comments on commit a5fb75f

Please sign in to comment.