Skip to content

Commit 9c14558

Browse files
committed
fix: trigger workflow on tag push
1 parent 11f598b commit 9c14558

2 files changed

Lines changed: 39 additions & 31 deletions

File tree

.github/workflows/docker.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Release
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
tags: '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '20.x'
16+
- run: npm i
17+
- name: Get latest Git tag
18+
id: tag
19+
run: |
20+
git fetch --tags
21+
TAG=$(git describe --tags --abbrev=0)
22+
echo "tag=$TAG" >> $GITHUB_OUTPUT
23+
- name: Extract metadata (tags, labels) for Docker
24+
id: meta
25+
uses: docker/metadata-action@v5
26+
with:
27+
images: ghcr.io/${{ github.repository_owner }}/stencil-cli
28+
context: git
29+
tags: |
30+
type=semver,pattern={{version}}
31+
# - name: Set up Docker Buildx
32+
# uses: docker/setup-buildx-action@v3
33+
34+
# - name: Build and push
35+
# uses: docker/build-push-action@v6
36+
# with:
37+
# push: true
38+
# tags: ${{ steps.meta.outputs.tags }}

.github/workflows/release.yml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stencil CLI Release
1+
name: NPM Release
22

33
on:
44
push:
@@ -23,33 +23,3 @@ jobs:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
GA_USERNAME: ${{ secrets.PAT_USERNAME }}
2525
GA_TOKEN: ${{ secrets.PAT_TOKEN }}
26-
27-
- name: Get latest Git tag
28-
id: tag
29-
run: |
30-
git fetch --tags
31-
TAG=$(git describe --tags --abbrev=0)
32-
echo "tag=$TAG" >> $GITHUB_OUTPUT
33-
- name: Log in to the Github Container registry
34-
uses: docker/login-action@v3
35-
with:
36-
registry: ghcr.io
37-
username: ${{ github.repository_owner }}
38-
password: ${{ secrets.GITHUB_TOKEN }}
39-
40-
- name: Extract metadata (tags, labels) for Docker
41-
id: meta
42-
uses: docker/metadata-action@v5
43-
with:
44-
images: ghcr.io/${{ github.repository_owner }}/stencil-cli
45-
context: git
46-
tags: |
47-
type=semver,pattern={{version}}
48-
- name: Set up Docker Buildx
49-
uses: docker/setup-buildx-action@v3
50-
51-
- name: Build and push
52-
uses: docker/build-push-action@v6
53-
with:
54-
push: true
55-
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)