Skip to content

Commit 12b86a1

Browse files
authored
Create .github/workflows/main.yml
1 parent a7fc5da commit 12b86a1

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/main.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Cache node modules
17+
id: cache-npm
18+
uses: actions/cache@v3
19+
env:
20+
cache-name: cache-node-modules
21+
with:
22+
path: node_modules
23+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-build-${{ env.cache-name }}-
26+
${{ runner.os }}-build-
27+
${{ runner.os }}-
28+
-
29+
name: Install dependencies
30+
run: npm install
31+
-
32+
name: Docker meta
33+
id: meta
34+
uses: docker/metadata-action@v4
35+
with:
36+
# list of Docker images to use as base name for tags
37+
images: |
38+
ghcr.io/reborniot/cssfavicon
39+
# generate Docker tags based on the following events/attributes
40+
tags: |
41+
type=schedule
42+
type=ref,event=branch
43+
type=ref,event=pr
44+
type=semver,pattern={{version}}
45+
flavor: |
46+
latest=false
47+
-
48+
name: Set up QEMU
49+
uses: docker/setup-qemu-action@v1
50+
-
51+
name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v1
53+
-
54+
name: Login to GitHub Container Registry
55+
uses: docker/login-action@v1
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
-
61+
name: Build and push
62+
uses: docker/build-push-action@v2
63+
with:
64+
context: .
65+
build-args:
66+
casino=production
67+
platforms: linux/amd64
68+
push: true
69+
tags: ${{ steps.meta.outputs.tags }}-production
70+
labels: ${{ steps.meta.outputs.labels }}-production
71+
-
72+
name: Build and push
73+
uses: docker/build-push-action@v2
74+
with:
75+
context: .
76+
build-args:
77+
casino=development
78+
platforms: linux/amd64
79+
push: true
80+
tags: ${{ steps.meta.outputs.tags }}-development
81+
labels: ${{ steps.meta.outputs.labels }}-development

0 commit comments

Comments
 (0)