Deploy #52
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 | |
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@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build.yml | |
github_token: ${{ secrets.PAT }} | |
name: github-pages | |
path: artifact | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
GIT_AUTHOR_NAME: 'GitHub Actions' | |
GIT_AUTHOR_EMAIL: 'action@github.com' | |
GIT_COMMITTER_NAME: 'GitHub Actions' | |
GIT_COMMITTER_EMAIL: 'action@github.com' | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
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/deploy-pages@v2 |