-
Notifications
You must be signed in to change notification settings - Fork 9
60 lines (56 loc) · 1.89 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SPDX-FileCopyrightText: 2017-2023 Joonas Javanainen <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
name: ci
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs:
build:
name: Build site (+ deploy if building master)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Check for unintended local changes (e.g. incorrect use of Git LFS)
run: git diff --exit-code
- name: Install Ubuntu packages
run: sudo apt install libncurses-dev libncursesw5-dev
- name: Install stable toolchain
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Cache dependencies
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
with:
cache-on-failure: true
- name: Build
run: cargo build --all --release
- name: Test
run: cargo test --all --release
- name: Run site generation
run: cargo run --release --bin gbhwdb-site
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
if: github.ref == 'refs/heads/master' && github.repository == 'Gekkio/gb-hardware-db'
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::570943329925:role/github-gb-hardware-db
role-session-name: Github-Actions
- name: Run site deployment
if: github.ref == 'refs/heads/master' && github.repository == 'Gekkio/gb-hardware-db'
run: target/release/gbhwdb-deploy
env:
GBHWDB_BUCKET: ${{ secrets.GBHWDB_BUCKET }}
GBHWDB_INVALIDATION_REF: ${{ github.sha }}
GBHWDB_DISTRIBUTION: ${{ secrets.GBHWDB_DISTRIBUTION }}