Deploy #56
This file contains hidden or 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 | |
on: | |
workflow_dispatch: | |
inputs: | |
force: | |
description: 'Force deploy' | |
required: false | |
default: 'false' | |
permissions: | |
contents: write | |
id-token: write | |
pages: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
name: 🚀 Deploy | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-22.04 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v8 | |
with: | |
workflow: build.yml | |
github_token: ${{ secrets.PAT }} | |
name: github-pages | |
path: artifact | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/[email protected] | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
GIT_AUTHOR_NAME: 'GitHub Actions' | |
GIT_AUTHOR_EMAIL: '[email protected]' | |
GIT_COMMITTER_NAME: 'GitHub Actions' | |
GIT_COMMITTER_EMAIL: '[email protected]' | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: github-pages | |
path: artifact | |
- name: Deploy to GitHub Pages | |
if: ${{ steps.semantic.outputs.new_release_published }} == 'true' || ${{ github.event.inputs.force }} == 'true' | |
id: deployment | |
uses: actions/[email protected] |