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
130 lines (115 loc) · 2.89 KB
/
release.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
release:
types: [published]
jobs:
load_code:
permissions:
contents: read
name: Load Code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Archive code
uses: actions/upload-artifact@v4.3.1
with:
name: source-code
path: .
build:
name: Build
needs: load_code
runs-on: ubuntu-latest
steps:
- name: Download code
uses: actions/download-artifact@v4.1.2
with:
name: source-code
path: .
- name: Setup Node 20
uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Upload builded code
uses: actions/upload-artifact@v4.3.1
with:
name: dist
path: dist
dist_to_page:
name: Dist to Page
needs: build
runs-on: ubuntu-latest
steps:
- name: Download builded code
uses: actions/download-artifact@v4.1.2
with:
name: dist
path: dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
name: github-pages
path: dist/
deploy:
name: Deploy
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: https://maxmielchen.github.io/stft/
runs-on: ubuntu-latest
needs: dist_to_page
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.4
metadata:
name: Metadata
runs-on: ubuntu-latest
steps:
- id: meta
name: Extract metadata
uses: docker/metadata-action@v5.5.1
with:
images: ghcr.io/${{ github.repository }}
outputs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
containerize:
name: Containerize
needs: [load_code, metadata]
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
- name: Download code
uses: actions/download-artifact@v4.1.2
with:
name: source-code
path: .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to ghcr.io
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to ghcr.io
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ needs.metadata.outputs.tags }}
labels: ${{ needs.metadata.outputs.labels }}