Release 5.0.1 #32
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: Release on semver tag | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
release: | |
env: | |
tag: ${{ github.ref_name }} | |
tag_ref: ${{ github.ref }} | |
base_branch: "dev" | |
base_branch_ref: "origin/dev" | |
dist_branch: dist/frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull main branch | |
run: | | |
git fetch origin $base_branch | |
- name: Are we on the tip of the main branch? | |
run: | | |
set -e -x | |
git fetch origin | |
exec >> $GITHUB_ENV | |
if [ "$(git rev-parse $tag_ref)" = "$(git rev-parse $base_branch_ref)" ]; then | |
echo is_uptodate=true | |
else | |
echo is_uptodate=false | |
fi | |
- uses: andymckay/[email protected] | |
if: ${{ env.is_uptodate == 'false' }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --network-timeout 1000000 | |
- run: yarn dist | |
- name: Pluck gh-pages/ directory out of dist/ | |
run: | | |
mkdir gh-pages | |
(cd dist; tar --exclude package.json -clf - .) | \ | |
(cd gh-pages; tar xpvf -) | |
- uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages | |
- name: Pluck frontend/ directory out of dist/ | |
run: | | |
mkdir frontend | |
(cd dist; tar --exclude components --exclude docs \ | |
--exclude images/styleguide --exclude index.html \ | |
--exclude "reader.*" -clf - .) | \ | |
(cd frontend; tar xpvf -) | |
- name: Deploy to “dist/frontend” branch | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./frontend | |
publish_branch: ${{ env.dist_branch }} | |
- uses: "marvinpinto/[email protected]" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false |