chore(git): merge pull request #245 from github-pages into staging
Reviewed-on: #245
This commit is contained in:
commit
012180948a
61
.github/workflows/release-pages-production.yaml
vendored
61
.github/workflows/release-pages-production.yaml
vendored
@ -1,5 +1,5 @@
|
|||||||
# Simple workflow for deploying static content to GitHub Pages
|
# Deploying to GitHub Pages
|
||||||
name: Release to DEG-Mods.github.io
|
name: Release to DEGMods.github.io/DEG-Mods
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -8,15 +8,21 @@ on:
|
|||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# Allow one concurrent deployment
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||||
|
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||||
concurrency:
|
concurrency:
|
||||||
group: 'pages'
|
group: 'pages'
|
||||||
cancel-in-progress: true
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Build job
|
||||||
build:
|
build:
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -24,7 +30,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: '18'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@ -41,46 +47,19 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
|
||||||
path: './dist'
|
path: './dist'
|
||||||
|
|
||||||
|
# Deployment job
|
||||||
deploy:
|
deploy:
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Deploy to Github Pages
|
||||||
uses: actions/checkout@v4
|
id: deployment
|
||||||
with:
|
uses: actions.deploy-pages@v4
|
||||||
repository: ${{ vars.ORGANIZATION_NAME }}/${{ vars.REPOSITORY_NAME }}
|
|
||||||
path: ${{ vars.REPOSITORY_NAME }}
|
|
||||||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
- name: Clear target repo
|
|
||||||
run: |
|
|
||||||
rm -rf ${{ vars.REPOSITORY_NAME }}/*
|
|
||||||
|
|
||||||
- name: Download build artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: dist
|
|
||||||
path: ./dist
|
|
||||||
|
|
||||||
- name: Prepare files
|
|
||||||
run: |
|
|
||||||
cp -r dist/* ${{ vars.REPOSITORY_NAME }}/
|
|
||||||
echo ${{ vars.CUSTOM_DOMAIN }} > ${{ vars.REPOSITORY_NAME }}/CNAME
|
|
||||||
touch ${{ vars.REPOSITORY_NAME }}/.nojekyll
|
|
||||||
|
|
||||||
- name: Commit and push
|
|
||||||
run: |
|
|
||||||
cd ${{ vars.REPOSITORY_NAME }}
|
|
||||||
git config --global user.name 'github-actions[bot]'
|
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
||||||
git add .
|
|
||||||
git commit -m 'Deploy from source repo'
|
|
||||||
git push origin main
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user