-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (39 loc) · 1.21 KB
/
Copy pathimages.yml
File metadata and controls
50 lines (39 loc) · 1.21 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
name: Build Docker Image
on:
push:
tags: ["*"]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies (no lifecycle scripts)
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Rebuild explicitly trusted native deps
run: pnpm rebuild esbuild
- name: Build workspace
run: pnpm run build
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Build and push image
run: |
IMAGE_NAME="ghcr.io/${GITHUB_REPOSITORY,,}"
IMAGE_VERSION="${GITHUB_REF_NAME//\//-}"
docker buildx build --pull --push --platform linux/amd64 -t "${IMAGE_NAME}:${IMAGE_VERSION}" .
- name: Log out of registry
if: always()
run: docker logout ghcr.io