Skip to content

Commit bbca9d4

Browse files
committed
update workflows
1 parent b8cc9a7 commit bbca9d4

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master, minimal]
7+
8+
concurrency:
9+
group: "build-image-${{ github.ref }}"
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build-image:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
25+
26+
- name: Install Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build for production
36+
run: npm run build
37+
38+
- name: Choose image name
39+
id: image
40+
run: |
41+
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
42+
if [ "${{ github.ref_name }}" = "minimal" ]; then
43+
echo "name=ghcr.io/${owner}/blockextensions-minimal" >> "$GITHUB_OUTPUT"
44+
else
45+
echo "name=ghcr.io/${owner}/blockextensions" >> "$GITHUB_OUTPUT"
46+
fi
47+
48+
- name: Log in to GitHub Container Registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Collect image metadata
56+
id: meta
57+
uses: docker/metadata-action@v5
58+
with:
59+
images: ${{ steps.image.outputs.name }}
60+
tags: |
61+
type=sha,format=short,prefix=sha-
62+
type=raw,value=latest
63+
64+
- name: Set up Buildx
65+
uses: docker/setup-buildx-action@v3
66+
67+
- name: Build and push image
68+
uses: docker/build-push-action@v6
69+
with:
70+
context: .
71+
file: docker/Dockerfile
72+
push: true
73+
provenance: false
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
build-args: |
77+
SOURCE_URL=${{ github.server_url }}/${{ github.repository }}
78+
REVISION=${{ github.sha }}

.github/workflows/deploy.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515

16-
# If you are forking and want to set up your own website, adjust the repository and branch
17-
# below to match your repository or remove the condition entirely.
18-
if: ${{ github.repository == 'TurboWarp/extensions' && github.ref == 'refs/heads/master' }}
16+
if: ${{ github.repository == 'CodeTorchNET/CodeTorch-Block-Extensions' && github.ref == 'refs/heads/master' }}
1917

2018
steps:
2119
- name: Checkout

0 commit comments

Comments
 (0)