Publish Site #9
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: Publish Site | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: | |
- "Run validation and build checks" | |
branches: | |
- main | |
types: | |
- completed | |
jobs: | |
publish: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
environment: prod | |
env: | |
CONTAINER_ENGINE: docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Retrieve cached build | |
uses: actions/cache@v4 | |
env: | |
cache-name: build-output | |
with: | |
path: public/ | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
- uses: actions/checkout@v4 | |
- name: Run check | |
run: make check | |
- name: Render site | |
run: make build | |
- name: Setup Deployment key | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.DEPLOY_KEY }}" | base64 -d > ~/.ssh/id_rsa | |
- name: Publish site | |
run: make publish | |
env: | |
TARGET_SYSTEM: ${{ secrets.TARGET_SYSTEM }} # This should be user@host | |