Add workflow for building and deploying and fill out README #1
Workflow file for this run
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: Build and deploy poster | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "**" | |
permissions: write-all | |
jobs: | |
build-and-deploy: | |
name: 'Build and publish' | |
runs-on: ubuntu-latest | |
if: "github.repository == 'IntelPython/portable-data-parallel-extensions-scipy-2024' && !contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.6.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
persist-credentials: false | |
- name: Install Golang | |
shell: bash -l {0} | |
run: | | |
sudo apt-get install golang | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build site | |
shell: bash -l {0} | |
run: | | |
hugo version | |
npm --version | |
node -v | |
ls -l | |
sudo npm cache clean -f | |
npm install -D autoprefixer | |
npm install -D postcss-cli | |
npm install -D postcss | |
hugo --minify || exit 1 | |
cp -r ./public ~/public || exit 1 | |
git checkout . | |
- name: Deploy site | |
uses: actions/upload-artifact@v2 | |
if: ${{ github.event_name == 'pull_request'}} | |
with: | |
name: html | |
path: ./public | |
if-no-files-found: error | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[doc-deploy-bot]' | |
git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com' | |
- name: Checkout gh-pages | |
run: | | |
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/portable-data-parallel-extensions-scipy-2024.git | |
git fetch --all | |
git checkout --track tokened_docs/gh-pages | |
- name: Copy build artifact | |
shell: bash -l {0} | |
run: | | |
rm -rf * | |
cp -R ~/public/* . | |
- name: Commit changes | |
run: | | |
git add . && git commit -m "Deploy: ${{ github.sha }}" | |
continue-on-error: true | |
- name: Push changes | |
if: "success() && github.event_name != 'pull_request'" | |
run: | | |
git push tokened_docs gh-pages |