Actually fix default branch detection #1197
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: Pages | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: 'Deploy result to site' | |
required: false | |
type: boolean | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '14' | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-build-${{ env.cache-name }}- | |
${{ runner.OS }}-build- | |
${{ runner.OS }}- | |
- name: Install build dependencies | |
run: sudo apt-get install autoconf libtool pkg-config nasm build-essential libpng-dev | |
- name: Install dependencies | |
run: yarn install | |
- name: Validate translations | |
run: yarn validateTranslations | |
- name: Build for production | |
run: yarn build | |
env: | |
VUE_APP_PUBLIC_URL: https://roshar.17thshard.com/ | |
VUE_APP_GA_ID: ${{ secrets.GA_ID }} | |
- name: Create CNAME | |
uses: finnp/create-file-action@master | |
env: | |
FILE_NAME: "./dist/release/CNAME" | |
FILE_DATA: "roshar.17thshard.com" | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
path: 'dist/release' | |
deploy: | |
if: (github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && contains(github.event.head_commit.message, '[deploy]')) | |
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy) | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |