-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b12616
commit 291f78a
Showing
1 changed file
with
35 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
name: Scaleway builder/deployer | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build_and_deploy: | ||
name: Deploy Hugo Website | ||
runs-on: ubuntu-latest | ||
env: | ||
HUGO_VERSION: 0.129.0 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: setup hugo | ||
uses: peaceiris/actions-hugo@v3 | ||
with: | ||
hugo-version: '0.138.0' | ||
- name: build site | ||
run: hugo | ||
- name: deploy to s3 | ||
run: hugo deploy --force --maxDeletes -1 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_ACCESS_KEY }} | ||
- 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_withdeploy.deb \ | ||
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb | ||
- name: Install Dart Sass | ||
run: sudo snap install dart-sass | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Node.js dependencies | ||
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | ||
|
||
- name: Build with Hugo | ||
env: | ||
HUGO_ENVIRONMENT: production | ||
HUGO_ENV: production | ||
run: hugo --minify | ||
|
||
- name: Deploy to S3 | ||
run: hugo deploy --force --maxDeletes -1 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_ACCESS_KEY }} |