-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.45 KB
/
cd.yml
File metadata and controls
51 lines (41 loc) · 1.45 KB
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: Release & Deploy
on:
workflow_run:
workflows: [Test]
branches: master
types: completed
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'good-tools/good.tools' }}
steps:
- uses: actions/checkout@v3
- name: Configure Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
cache: "npm"
- name: Load Dependencies
run: npm ci
- name: Build Sitemap
run: npm run build-sitemap
- name: Build Application
run: npm run build
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: Configure AWS credentials
if: steps.release.outputs.released == '1'
uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy
if: steps.release.outputs.released == '1'
run: aws s3 sync ./dist/ s3://${{ secrets.S3_BUCKET }} --delete
- name: CF Invalidation
if: steps.release.outputs.released == '1'
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/*"