Update guildRandomID.md (#228) #511
This file contains hidden or 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
name: Deploy to GitHub Pages π | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
PUBLIC_BUILD_TIME: ${{ github.event.head_commit.timestamp }} | |
PUBLIC_COMMIT: ${{ github.sha }} | |
GHTOKEN: ${{ secrets.GHTOKEN }} | |
PUBLIC_ENV: "production" | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: π Modify Environment variables (commit) | |
id: vars | |
run: | | |
shortCommit=$(git rev-parse --short ${{ github.sha }}) | |
echo "::set-env name=PUBLIC_COMMIT::$shortCommit" | |
- name: π Modify Environment variables (time) | |
id: time | |
run: | | |
time=$(date +'%d/%m/%Y %H:%M:%S') | |
echo "::set-env name=PUBLIC_BUILD_TIME::$time" | |
- name: π Set Environment variables | |
run: | | |
echo "PUBLIC_BUILD_TIME: $PUBLIC_BUILD_TIME" | |
echo "PUBLIC_COMMIT: $PUBLIC_COMMIT" | |
echo "PUBLIC_ENV: $PUBLIC_ENV" | |
- name: βοΈ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: "./package-lock.json" | |
- name: npm bug | |
shell: "bash" | |
run: | | |
rm -rf node_modules | |
rm -f package-lock.json | |
- name: β»οΈ Install Packages | |
shell: "bash" | |
run: | | |
npm install --legacy-peer-deps | |
npm install react-dom --legacy-peer-deps | |
- name: π§βπ» Build | |
shell: "bash" | |
run: npm run build | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: ./dist | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: π Deploy to Github | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
- name: Wait for site to be deployed | |
if: 1 == 2 | |
run: sleep 5 | |
- name: π Update Algolia Crawler (skip) | |
if: 1 == 2 | |
uses: algolia/algoliasearch-crawler-github-actions@v1.1.0 | |
id: algolia_crawler | |
with: | |
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} | |
crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} | |
algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} | |
algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} | |
site-url: "https://aoi.js.org" | |
crawler-name: aoi-js-org |