-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (85 loc) · 3.06 KB
/
job.docker-osint-image.yml
File metadata and controls
97 lines (85 loc) · 3.06 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build OSINT Image
on:
push:
tags:
- 'v*' # Trigger for tags starting with 'v' (e.g., v1.0, v2.3.1)
- '!v*-beta' # Exclude beta tags
paths:
- 'apps/characters/**'
- 'apps/guilds/**'
- 'apps/osint/**'
- 'apps/wow-progress/**'
- 'libs/**'
- 'docker/arm64.osint.Dockerfile'
- 'docker/x64.osint.Dockerfile'
- 'package.json'
jobs:
publish:
name: publish
runs-on: self-hosted
permissions:
contents: read
packages: read # Important: Grant read access to packages
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get the tag name
id: get_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set OCI build args
run: |
echo "OCI_CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "OCI_REVISION=${GITHUB_SHA}" >> $GITHUB_ENV
echo "OCI_VERSION=${TAG_NAME}" >> $GITHUB_ENV
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Enable corepack
run: corepack enable
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.7.0
with:
images: |
ghcr.io/alexzedim/osint
tags: |
type=ref,event=tag,value=${{ env.TAG_NAME }}
type=raw,value=latest
labels: |
maintainer=alexzedim
org.opencontainers.image.title=CMNW OSINT
org.opencontainers.image.description=OSINT - Intelligence always wins
org.opencontainers.image.vendor=alexzedim
org.opencontainers.image.url=https://cmnw.me
org.opencontainers.image.source=https://github.com/alexzedim/cmnw
org.opencontainers.image.documentation=https://github.com/alexzedim/cmnw#readme
org.opencontainers.image.licenses=MPL-2.0
org.opencontainers.image.logo=https://raw.githubusercontent.com/alexzedim/cmnw-next/master/public/static/cmnw.png
org.opencontainers.image.created=${{ env.OCI_CREATED }}
org.opencontainers.image.revision=${{ env.OCI_REVISION }}
org.opencontainers.image.version=${{ env.OCI_VERSION }}
- name: Login to Github Packages
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- name: Build & Push (GHCR)
id: build-push-action
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/x64.osint.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
OCI_CREATED=${{ env.OCI_CREATED }}
OCI_REVISION=${{ env.OCI_REVISION }}
OCI_VERSION=${{ env.OCI_VERSION }}
- name: Image digest
run: |
echo "Tag name ${{ steps.package-version.outputs.current-version}}"