forked from tv2/sisyfos-audio-controller
-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (67 loc) · 1.95 KB
/
deploy-image.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Node CI
on:
push:
branches:
- '**'
tags:
- 'v**'
workflow_dispatch:
jobs:
run-yarn-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
run: yarn install --check-files --frozen-lockfile
# - name: yarn validate:dependencies
# run: |
# if ! git log --format=oneline -n 1 | grep -q "\[ignore-audit\]"; then
# yarn validate:dependencies
# else
# echo "Skipping audit"
# fi
- name: yarn build
run: yarn build
- name: yarn unit test
run: yarn test
docker-release:
runs-on: ubuntu-latest
needs: [run-yarn-build]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Get the Docker tag for GHCR
id: ghcr-tag
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR
uses: docker/build-push-action@v3
with:
context: .
push: true
provenance: false
labels: ${{ steps.ghcr-tag.outputs.labels }}
tags: "${{ steps.ghcr-tag.outputs.tags }}"