-
-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (50 loc) · 1.38 KB
/
build.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
61
name: Build latest server versions
on:
push:
branches:
- '*'
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
use_cache:
description: 'Use docker cache [cache/nocache]'
required: true
default: 'cache'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "docker"
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Update dependencies
working-directory: ./build
run: npm i
- name: Extract cache
id: cache
shell: bash
run: |
echo "VERSION=${{ github.event.inputs.CACHE }}" >> $GITHUB_OUTPUT
- name: Build
run: |
export ACTIONS_CACHE_URL=$(echo "$ACTIONS_ID_TOKEN_REQUEST_URL" | grep -Po 'https://[^/]+/[^/]+/' | sed 's/pipelines/artifactcache/')
export ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN
node ./build/index.js ${{ steps.version.outputs.CACHE }}
env:
FORCE_COLOR: 2