-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.1 KB
/
main.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
# © 2019-2024 Serokell <[email protected]>
# © 2019-2024 Lars Jellema <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
name: CI
on:
push:
env:
CDN_DISTRIBUTION_ID: E13UN1J1JFIWUZ
CDN_BUCKET: s3://nixfmt.serokell.io
jobs:
build:
runs-on: [self-hosted, nix]
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- name: build nixfmt-js
run: nix build .#nixfmt-js
- name: build webdemo
run: nix build .#nixfmt-webdemo
deploy:
runs-on: [self-hosted, nix]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- name: deploy webdemo
run: |
nix build .#nixfmt-webdemo
nix shell .#awscli -c aws s3 cp --recursive result/ "$CDN_BUCKET"
# delete files that don't exist anymore, use `--size-only` so behavior won't depend on local file timestamps
nix shell .#awscli -c aws s3 sync --delete --size-only result/ "$CDN_BUCKET"
nix shell .#awscli -c aws cloudfront create-invalidation --distribution-id "$CDN_DISTRIBUTION_ID" --paths '/*'