-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from weaponsforge/feat/weaponsforge-5
Feat/weaponsforge 5 - deploy to production
- Loading branch information
Showing
3 changed files
with
80 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
# This workflow will trigger on any tag/release created on *any* branch | ||
# Make sure to create tags/releases only from the "master" branch for consistency | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
lint-export-client: | ||
name: Lint and Export client | ||
runs-on: ubuntu-latest | ||
env: | ||
NEXT_PUBLIC_BASE_PATH: ${{ secrets.NEXT_PUBLIC_BASE_PATH }} | ||
NEXT_PUBLIC_FIREBASE_WEB_API_KEY: ${{ secrets.PROD_FIREBASE_WEB_API_KEY }} | ||
NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN: ${{ secrets.PROD_FIREBASE_WEB_AUTHDOMAIN }} | ||
NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID: ${{ secrets.PROD_FIREBASE_WEB_PROJECT_ID }} | ||
NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET: ${{ secrets.PROD_FIREBASE_WEB_STORAGE_BUCKET }} | ||
NEXT_PUBLIC_FIREBASE_WEB_MESSAGING_SENDER_ID: ${{ secrets.PROD_FIREBASE_WEB_MESSAGING_SENDER_ID }} | ||
NEXT_PUBLIC_FIREBASE_WEB_APP_ID: ${{ secrets.PROD_FIREBASE_WEB_APP_ID }} | ||
NEXT_PUBLIC_FIREBASE_WEB_MEASUREMENT_ID: ${{ secrets.PROD_FIREBASE_WEB_MEASUREMENT_ID }} | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
- name: Use NodeJS v20.15.0 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.15.0 | ||
- name: Install Dependencies and lint | ||
run: | | ||
cd app | ||
npm install | ||
- name: Lint | ||
run: | | ||
cd app | ||
npm run lint | ||
- name: Export static files | ||
run: | | ||
cd app | ||
npm run export | ||
mv out/404/index.html out/404.html | ||
- name: Disable Jekyll | ||
run: touch app/out/.nojekyll | ||
- name: Archive Development Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: main-out | ||
path: app/out | ||
retention-days: 3 | ||
|
||
deploy-client: | ||
name: Deploy client to Github Pages | ||
needs: lint-export-client | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: main-out | ||
- name: List files for publish | ||
run: ls -l -a | ||
- name: Deploy to Github Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./ | ||
publish_branch: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters