-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 1.92 KB
/
publish.yml
File metadata and controls
78 lines (64 loc) · 1.92 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
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
name: Publish
on:
push:
tags:
- 'v*'
jobs:
publish-npm:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
build-publish-docker:
name: Build & Push Docker Images
runs-on: ubuntu-latest
needs: publish-npm
permissions:
contents: read
packages: write
steps:
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: version
run: |
TAG=$GITHUB_REF_NAME
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$(echo -n "$TAG" | cut -c '2-')" >> "$GITHUB_OUTPUT"
- name: "Build & Push slim"
uses: docker/build-push-action@v7
with:
tags: |
ghcr.io/n-e/actions-oidc-trigger:${{ steps.version.outputs.version }}-slim
ghcr.io/n-e/actions-oidc-trigger:slim
ghcr.io/n-e/actions-oidc-trigger:latest
push: true
target: slim
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
TAG=${{ steps.version.outputs.tag }}
- name: "Build & Push docker-cli"
uses: docker/build-push-action@v7
with:
tags: |
ghcr.io/n-e/actions-oidc-trigger:${{ steps.version.outputs.version }}-docker-cli
ghcr.io/n-e/actions-oidc-trigger:docker-cli
push: true
target: docker-cli
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
TAG=${{ steps.version.outputs.tag }}