-
Notifications
You must be signed in to change notification settings - Fork 8
128 lines (122 loc) · 4.45 KB
/
Copy pathcontainer.yml
File metadata and controls
128 lines (122 loc) · 4.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Test and publish alpha container
on:
pull_request:
push:
branches: [master, release]
schedule:
- cron: '17 16 * * *'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: container-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 26
cache: npm
- name: Install locked dependencies
run: npm ci
- name: Generate installable app icons
run: npm run generate:icons
- name: Validate release notes
run: node scripts/release-notes.js validate
- name: Audit production dependencies
run: npm audit --omit=dev
- name: Run tests
run: npm test
- name: Check JavaScript syntax
run: npm run check
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
- name: Select build metadata
id: version
shell: bash
run: |
if [[ "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/master ]]; then
echo "version=sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "channel=alpha" >> "$GITHUB_OUTPUT"
else
echo "version=dev" >> "$GITHUB_OUTPUT"
echo "channel=dev" >> "$GITHUB_OUTPUT"
fi
- name: Build container without publishing
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
push: false
load: true
tags: js-playground:ci
build-args: |
BUILD_VERSION=${{ steps.version.outputs.version }}
BUILD_CHANNEL=${{ steps.version.outputs.channel }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build pinned vulnerability scanner
run: docker build --file security/Dockerfile --tag arcade-trivy:ci security
- name: Scan container for fixable high-severity vulnerabilities
run: >
docker run --rm
--volume /var/run/docker.sock:/var/run/docker.sock
arcade-trivy:ci image
--scanners vuln
--ignore-unfixed
--severity HIGH,CRITICAL
--exit-code 1
js-playground:ci
publish-alpha:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [test, build]
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v4.4.0
- name: Log in to Docker Hub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate alpha image tags and labels
id: metadata
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/js-playground
tags: |
type=raw,value=alpha
type=sha,prefix=sha-
- name: Select alpha build version
id: version
shell: bash
run: echo "value=sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Build and push multi-platform alpha image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
BUILD_VERSION=${{ steps.version.outputs.value }}
BUILD_CHANNEL=alpha
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: mode=max
sbom: true