-
-
Notifications
You must be signed in to change notification settings - Fork 63
51 lines (44 loc) · 1.69 KB
/
deploy.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
name: deploy
on:
push:
branches:
- master
repository_dispatch:
types: [build]
workflow_dispatch:
jobs:
release:
name: Build and deploy site
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download external project files
run: |
wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/CHANGELOG.md -O external/changelog.md
wget https://raw.githubusercontent.com/netbootxyz/build-pipelines/master/README.md -O external/build-automation.md
wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/master/CONTRIBUTING.md -O external/contributing.md
curl https://raw.githubusercontent.com/netbootxyz/docker-netbootxyz/master/README.md | tail -n+6 > external/docker.md
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Build static site
run: yarn run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_DOCS }}
aws-region: ${{ secrets.AWS_ACCESS_REGION }}
- name: Deploy site to bucket
run: |
aws s3 sync --no-progress --acl public-read build s3://${{ secrets.BUCKET_SITE }}
- name: Invalidate Cloudfront
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_SITE }} --paths "/*"