Painfully update configs and add some metadata for builds

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-07-12 16:30:36 +00:00
parent 12ce4027df
commit 4ae868cf37
3 changed files with 21 additions and 10 deletions

View file

@ -26,7 +26,7 @@ concurrency:
jobs: jobs:
gh-pages: gh-pages:
if: github.event_name == "push" || "workflow_dispatch" if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
@ -39,8 +39,6 @@ jobs:
with: with:
python-version: 3.10 python-version: 3.10
cache: pip cache: pip
- name: Install dependencies
uses: brettcannon/pip-secure-install@v1.0.0
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v3 uses: actions/configure-pages@v3
- name: Build - name: Build
@ -48,18 +46,30 @@ jobs:
sudo apt-get install \ sudo apt-get install \
libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev \ libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev \
--yes --yes
FF_ENABLE_COMMIT_DATA=true FF_GENERATE_SOCIAL_CARDS=true mkdocs build --use-directory-urls FF_ENABLE_COMMIT_DATA=true FF_GENERATE_SOCIAL_CARDS=true bash ./build.sh
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1
with: with:
path: './public' path: './public'
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: gh-pages
uses: actions/deploy-pages@v2 uses: actions/deploy-pages@v2
- name: Deploy to pages.dev
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: cf0bd808c6a294fd8c4d8f6d2cdeca05
projectName: ajhalili2006
directory: public
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main
repo-sync: repo-sync:
name: Repository sync name: Repository sync
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == "push" || "workflow_dispatch" if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
steps: steps:
- name: Checkout repository with full history - name: Checkout repository with full history
uses: actions/checkout@v3 uses: actions/checkout@v3

View file

@ -1,4 +1,4 @@
name: Docker name: Docker CI
# This workflow uses actions that are not certified by GitHub. # This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by # They are provided by a third-party and are governed by
@ -23,8 +23,8 @@ env:
jobs: jobs:
build: build-devenv:
name: Build development environment
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@ -45,7 +45,6 @@ jobs:
with: with:
cosign-release: 'v1.13.1' cosign-release: 'v1.13.1'
# Workaround: https://github.com/docker/build-push-action/issues/461 # Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx - name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

View file

@ -11,5 +11,7 @@ if [[ ! -d "$PWD/.venv" ]]; then
fi fi
$PWD/.venv/bin/pip3 install -r requirements.txt --upgrade $PWD/.venv/bin/pip3 install -r requirements.txt --upgrade
$PWD/.venv/bin/mkdocs build -d $TARGET_DIR $PWD/.venv/bin/mkdocs build -d $TARGET_DIR
mkdir "$TARGET_DIR/api"
git rev-parse HEAD > "$TARGET_DIR/api/commit"
set +xe set +xe