Skip to content

Build

Build #31

Workflow file for this run

name: "Build"
on:
workflow_dispatch:
schedule:
- cron: '25 6 1,10,20 * *' # At 06:25 on day-of-month 1, 10, and 20.
env:
AWS_REGION : "us-east-1"
AWS_ROLE: ${{ secrets.AWS_ROLE }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
website:
name: Website
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
runs-on: ubuntu-latest
steps:
- name: 🐧 Install dependencies
run: |
sudo apt-get install \
libdbd-sqlite3-perl \
libjson-xs-perl \
libtemplate-perl \
sqlite3
- name: 🛎️ Checkout
uses: actions/checkout@v4
# Configure AWS Credentials for GitHub Actions
# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- id: auth
name: 🔐 Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: 🔨 Run build script
run: |
cd build || exit 9
bash build.sh || exit 9
- name: 📑 Create website
run: |
cd build || exit 9
perl web.pl || exit 9
- name: 🧪 Tests
run: |
jq -e '.[] | .name' "web/images.json" | grep "ubuntu-minimal/images/hvm-ssd/ubuntu-jammy-22.04-amd64" || exit 9
- name: Commit last build
run: |
cd build || exit 9
bash commit.sh || exit 9
- name: 🌍 Setup Pages
uses: actions/configure-pages@v5
# https://github.com/marketplace/actions/upload-github-pages-artifact
- name: 🌍 Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'web/'
# https://github.com/marketplace/actions/deploy-github-pages-site
- name: 🌍 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4