Name Change #60
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: ci-cd | |
on: | |
[pull_request, push, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Install dependencies π | |
run: | | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
- name: Build Jekyll for GitHub Pages π·π»ββοΈ | |
uses: actions/[email protected] | |
with: | |
source: ./ | |
destination: ./_site | |
future: true | |
build_revision: ${{ github.sha }} | |
verbose: true | |
token: ${{ github.token }} | |
- name: Upload GitHub Pages artifact π¦ | |
uses: actions/[email protected] | |
get-artifact: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Download Artifact πΎ | |
uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
deploy: | |
# Use branch name for whatever purpose | |
needs: [get-artifact, build] | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Get branch name | |
run: echo 'The branch name is' $BRANCH_NAME | |
- name: Deploy GitHub Pages site π | |
id: deployment | |
uses: actions/[email protected] | |