Update Workflows #9
Workflow file for this run
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: Deploy Website | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# Build the project to ensure it works. Also to get the binaries. | |
build-website: | |
uses: ./.github/workflows/build-base.yml | |
with: | |
zig-version: ${{ vars.TARGET_ZIG_VERSION }} | |
get-submodules: true | |
target-os: Linux | |
github-artifact-name: website-build | |
artifact-output-path: website/zig-out | |
working-directory: website | |
# Publish microzig | |
publish-website: | |
uses: ./.github/workflows/publish-base.yml | |
needs: build-website | |
concurrency: | |
group: publish | |
cancel-in-progress: false | |
with: | |
github-artifact-name: website-build | |
source-path: / | |
secrets: | |
target-path: ${{ github.event_name == 'pull_request' && format('{0}/staging/pulls/{1}', secrets.DEPLOY_ROOT_DATA_PATH, github.event.number) || secrets.DEPLOY_ROOT_DATA_PATH }} | |
ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }} | |
host: ${{ secrets.DEPLOY_HOST }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
user: ${{ secrets.DEPLOY_USER }} | |
pr-comment: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
needs: publish-website | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: mshick/add-pr-comment@v2 | |
with: | |
message: | | |
Heya! | |
You can check out a preview of your PR at [${{ vars.WEBSITE_STAGING_HOST }}/pulls/${{ github.event.number }}/](${{ vars.WEBSITE_STAGING_HOST }}/pulls/${{ github.event.number }}/)! |