Skip to content

Migrate to OIDC

Migrate to OIDC #66

Workflow file for this run

name: ci
on:
- push
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs:
build:
name: Build PDF
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Update Ubuntu package lists
run: sudo apt update
- name: Install Ubuntu packages
run: >
sudo apt install
fonts-anonymous-pro
fonts-noto-core
- name: Install tools
run: |
mkdir -p "$HOME/.local/bin"
cd "$HOME/.local/bin"
curl -L https://github.com/typst/typst/releases/download/v0.11.0/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ --strip-components=1 typst-x86_64-unknown-linux-musl/typst
curl -L https://github.com/casey/just/releases/download/1.25.2/just-1.25.2-x86_64-unknown-linux-musl.tar.gz | tar -xz just
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Font Awesome
run: |
mkdir -p "$HOME/.fonts"
curl -L https://github.com/FortAwesome/Font-Awesome/releases/download/6.5.1/fontawesome-free-6.5.1-desktop.zip -o fontawesome.zip
unzip -j fontawesome.zip 'fontawesome-free-6.5.1-desktop/otfs/*' -d "$HOME/.fonts"
fc-cache
- run: just build
- name: Upload built PDF
uses: actions/upload-artifact@v4
with:
name: pdf
path: gbctr.pdf
deploy:
name: Deploy PDF
needs: [build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Update Ubuntu package lists
run: sudo apt update
- name: Install Ubuntu packages
run: sudo apt install awscli
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::570943329925:role/github-gb-ctr
role-session-name: Github-Actions
- name: Download built PDF
uses: actions/download-artifact@v4
with:
name: pdf
- name: Upload to S3
run: |
aws s3 cp gbctr.pdf s3://gbdocs.gekkio.fi/gbctr.pdf