Don't try to serve frontend/dist if it doesn't exist. Closes #41. #53
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: Build and Commit to Canary | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: canary # Specify the environment | |
permissions: | |
contents: write # Grant write permission to the contents scope | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Install frontend dependencies | |
working-directory: frontend | |
run: npm ci | |
- name: Build frontend | |
working-directory: frontend | |
run: npm run build | |
- name: Import GPG key | |
run: | | |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} # F1E9CF7FAEE383E9 | |
- name: Commit and push to canary branch | |
run: | | |
export GPG_TTY=$(tty) | |
git config --global user.name '${{ vars.GPG_USER_NAME }}' | |
git config --global user.email '${{ vars.GPG_USER_EMAIL }}' | |
git config --global commit.gpgSign true | |
git config --global user.signingkey ${{ vars.GPG_KEY_ID }} | |
git checkout main | |
git checkout -B canary | |
git add -f frontend/dist | |
git commit -S -m "Update canary with latest build from main" | |
git push origin canary --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |