Skip to content

Add more sections to the aws-nuke post #39

Add more sections to the aws-nuke post

Add more sections to the aws-nuke post #39

Workflow file for this run

name: cicd
on:
push:
workflow_dispatch:
defaults:
run:
shell: bash
env:
LIVE_ENV_NAME: leolleo.dev
LIVE_ENV_URL: https://leolleo.dev
PREVIEW_ENV_DOMAIN: garden-cbf.pages.dev
jobs:
infos:
runs-on: ubuntu-latest
outputs:
ref_name_slug: ${{ steps.infos.outputs.ref_name_slug }}
env_name: ${{ steps.infos.outputs.env_name }}
url: ${{ steps.infos.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- id: infos
run: ./gen_infos.sh
working-directory: .github/scripts
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.3
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- run: npm ci
- run: hugo
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: build
path: public
deploy:
concurrency:
group: "${{ needs.infos.outputs.ref_name_slug }}"
cancel-in-progress: true
environment:
name: ${{ needs.infos.outputs.env_name }}
url: ${{ needs.infos.outputs.url }}
runs-on: ubuntu-latest
needs:
- infos
- build
steps:
- name: Downloads artifact
uses: actions/download-artifact@v3
with:
name: build
path: public
- name: Publish app
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: pages publish --branch ${{ needs.infos.outputs.ref_name_slug }} --project-name blog ./public
- name: Purge cloudflare cache
if: github.ref == 'refs/heads/main'
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/a5f4d54fc54af37e05218d9b4e8cd4d9/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'