Merge branch 'main' into dev #107
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
name: Website | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 4 * * *' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }} | |
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }} | |
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }} | |
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }} | |
ALLOW_ROBOTS: true | |
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }} | |
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }} | |
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }} | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: oven-sh/setup-bun@v1 | |
- uses: actions/configure-pages@v5 | |
- name: Install dependencies | |
run: bun install | |
- name: Build website | |
run: bun run build:website | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist/website | |
deploy-github-pages: | |
if: github.ref == 'refs/heads/main' | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: Production | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
deploy-vercel: | |
name: Deploy to Vercel | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: Preview | |
steps: | |
# vercel begs for the .git dir so here it is my guy | |
- uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./dist/website | |
- uses: amondnet/vercel-action@v25 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
working-directory: ./dist/website |