-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (51 loc) · 1.47 KB
/
build.yml
File metadata and controls
60 lines (51 loc) · 1.47 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
name: Docker Image CI
on:
push:
branches: [master]
concurrency:
group: "build-and-push"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
env:
IMAGE: ghcr.io/progsoc/club-voting-system
REGISTRY: ghcr.io
NODE_ENV: production
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: init gel
run: cd apps/server && bunx gel project init --non-interactive
- name: Docker Meta Release
id: meta-release
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
# use custom value instead of git tag
type=raw,value=latest
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
tags: ${{ steps.meta-release.outputs.tags }}
push: true
context: .
labels: ${{ steps.meta-release.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE }}:latest