Skip to content

Update bump.md

Update bump.md #379

name: Branch Build Hugo - EN
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "!contents/**" # Exclude the contents folder
- "!github/**" # Exclude the .github folder
- "!git/**" # Exclude the .git folder
- "bump.md"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_WORKER_NAME: ${{ secrets.CLOUDFLARE_WORKER_NAME }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
DOMAIN: ${{ secrets.DOMAIN }}
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.113.0"
extended: true
- name: Print PWD
run: pwd
- name: Build Hugo site
uses: actions/cache@v3
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-en
restore-keys: |
${{ runner.os }}-hugomod-en
- name: Build Hugo site
run: hugo --cleanDestinationDir -D -E -F --minify --enableGitInfo --cacheDir /tmp/hugo_cache --config /home/runner/work/simeononsecurity.ch/simeononsecurity.ch/config/language/en/config.toml
- name: Delete non-public folders and files
run: |
find . -mindepth 1 -type d ! -path './public*' ! -path './.git*' ! -path './.github*' -print0 | xargs -0 rm -rf
find . -maxdepth 1 -type f -not -name 'netlify.toml' -print0 | xargs -0 rm -f
- name: Move files to root
run: |
mv ./public/* .
rm -r ./public
- name: Commit and push changes
run: |
git config user.name "${{ secrets.USERNAME }}"
git config user.email "${{ secrets.EMAIL }}"
git add .
git commit -m "Update website-en branch"
git push --force --quiet origin HEAD:refs/heads/website-en
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# - name: Download cf-workers-site-template repository
# run: |
# git clone https://github.com/simeononsecurity/cf-workers-site-template
# - name: Create cf-workers-site-template/public directory
# run: mkdir -p cf-workers-site-template/public
# - name: Move files to cf-workers-site-template/public
# run: |
# find . -maxdepth 1 -not -name "cf-workers-site-template" -exec mv {} cf-workers-site-template/public/ \;
# - name: Publish the site
# run: |
# cd cf-workers-site-template
# yarn global add wrangler
# yarn install
# yarn global list
# npm update -g wrangler
# echo "${CLOUDFLARE_API_TOKEN}" | npx @cloudflare/wrangler config
# yarn run publish
# # - name: Deploy to Cloudflare Workers
# # uses: cloudflare/[email protected]
# # with:
# # apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# # accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# # workingDirectory: "cf-workers-site-template"