This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
chore(deps): update actions/checkout digest to 0ad4b8f (#24) #26
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- main | |
paths: | |
- '.github/workflows/release.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true | |
steps: | |
- name: Get current date | |
id: date | |
run: | | |
# shellcheck disable=SC2086 | |
echo "datetime=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT | |
- name: Clone jaoafa/jaoweb4 | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
repository: jaoafa/jaoweb4 | |
- name: Remove content | |
run: rm -rf content | |
# - name: Clone jaoafa/jaoweb-docs | |
# uses: actions/checkout@v3 | |
# with: | |
# repository: jaoafa/jaoweb-docs | |
# path: content | |
# - name: Download authors.json & categories.json | |
# run: | | |
# mkdir -p content/blog | |
# wget -O content/blog/authors.json https://raw.githubusercontent.com/jaoafa/jaoweb/master/content/blog/authors.json | |
# wget -O content/blog/categories.json https://raw.githubusercontent.com/jaoafa/jaoweb/master/content/blog/categories.json | |
- name: Set up Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Nuxt generate | |
run: npm run generate | |
- name: Check exists .output/public | |
run: | | |
ls -la | |
test -d .output/public | |
- name: Set jaoweb SHORT_SHA | |
id: jaoweb-vars | |
run: | | |
# shellcheck disable=SC2086 | |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
# - name: Set jaoweb-docs SHORT_SHA | |
# id: docs-vars | |
# working-directory: ./content | |
# run: | | |
# # shellcheck disable=SC2086 | |
# echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Print versions | |
run: | | |
# shellcheck disable=SC2086,SC2129 | |
sudo apt-get install pandoc | |
cat << EOF > dist/versions.md | |
# Build versions | |
datetime: ${{ steps.date.outputs.datetime }} | |
- jaoweb: [${{ steps.jaoweb-vars.outputs.SHORT_SHA }}](https://github.com/jaoafa/jaoweb/commit/${{ steps.jaoweb-vars.outputs.SHORT_SHA }}) | |
EOF | |
# - jaoweb-docs: [${{ steps.docs-vars.outputs.SHORT_SHA }}](https://github.com/jaoafa/jaoweb-docs/commit/${{ steps.docs-vars.outputs.SHORT_SHA }}) | |
pandoc -s dist/versions.md -o dist/versions.html | |
rm dist/versions.md | |
- name: Upload Pages-artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |