-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (70 loc) · 2.26 KB
/
build-and-publish.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build and Release
on:
push:
branches: ["saga"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
env:
CNAME: world.thingy.rocks
WEBSOCKET_ENDPOINT: wss://ouqkjmrbb8.execute-api.eu-central-1.amazonaws.com/2022-11-22
MAP_NAME: thingy-rocks-backend-map
COGNITO_IDENTITY_POOL_ID: eu-central-1:09c73822-5984-44ff-be03-db63403fdf59
SENTRY_DSN: https://f0636caa395147fcb07f781d0c1e8e6c@o4504255385174016.ingest.sentry.io/4504255391596544
jobs:
next-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.nextRelease }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- name: Get current release
run:
echo "currentRelease=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Determine next release version
uses: nordicsemiconductor/cloud-get-next-version-action@saga
id: version
with:
branch: saga
defaultVersion: "${{ env.currentRelease }}-${{ github.sha }}"
main:
runs-on: ubuntu-latest
needs: [next-release]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit
- run: npm test
- name: Build
env:
VERSION: ${{ needs.next-release.outputs.version }}
run: |
npm run build
cp -r ./static ./build
cp -r node_modules/svg-country-flags/svg/ ./build/static/flags
mkdir ./build/.well-known
echo ${{ needs.next-release.outputs.version }} > ./build/.well-known/release
- name: Deploy to CloudFlare pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
run:
npx wrangler pages publish build --project-name thingy-world --branch
saga --commit-hash ${{ github.sha }}
- name: Semantic release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
run: npx semantic-release