This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (93 loc) · 2.2 KB
/
pull_request.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
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
name: Pull Request
on:
pull_request:
branches:
- main
jobs:
load_code:
name: Load Code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Archive code
uses: actions/upload-artifact@v2
with:
name: source-code
path: .
build:
name: Build
needs: load_code
runs-on: ubuntu-latest
steps:
- name: Download code
uses: actions/download-artifact@v2
with:
name: source-code
path: .
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
buildx:
name: Buildx
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
login:
name: Login
needs: buildx
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Login to GHCR
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
metadata:
name: Metadata
needs: buildx
runs-on: ubuntu-latest
steps:
- id: meta
name: Extract metadata
uses: docker/metadata-action@v5.0.0
with:
images: ghcr.io/${{ github.repository }}/stft
- name: Archive metadata
uses: actions/upload-artifact@v2
with:
name: metadata
path: .docker
build_and_push:
name: Build and Push
needs: [load_code, buildx, login, metadata]
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download code
uses: actions/download-artifact@v2
with:
name: source-code
path: .
- name: Download metadata
uses: actions/download-artifact@v2
with:
name: metadata
path: .docker
- name: Push to GHCR
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64