-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (86 loc) · 3.07 KB
/
docker-image.yml
File metadata and controls
100 lines (86 loc) · 3.07 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
96
97
98
99
100
name: Docker Image CI
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_VERSION }}
- name: Set version based on tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Get current date in KST
run: echo "CURRENT_DATE_KST=$(date +'%Y%m%d-%H%M%S' -d '+9 hours')" >> $GITHUB_ENV
- name: Set lowercase repository owner
run: |
repo_owner_lowercase=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo "REPO_OWNER_LOWERCASE=$repo_owner_lowercase" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
navystack/nodebb
ghcr.io/${{ env.REPO_OWNER_LOWERCASE }}/nodebb-docker
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ env.CURRENT_DATE_KST }}
flavor: |
latest=true
- name: Docker meta
id: meta2
uses: docker/metadata-action@v5
with:
images: |
navystack/nodebb
ghcr.io/${{ env.REPO_OWNER_LOWERCASE }}/nodebb-docker
tags: |
type=raw,value=gosu-${{ env.CURRENT_DATE_KST }}
type=raw,value=gosu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up SSH
# uses: MrSquaare/ssh-setup-action@v3
# with:
# host: ${{ secrets.SSH_ARM64_RUNNER }}
# private-key: ${{ secrets.SSH_PRIVATE_KEY_ARM64_RUNNER }}
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
# with:
# endpoint: ${{ secrets.AMD64_RUNNER_ENDPOINT }}
# append: |
# - endpoint: ${{ secrets.ARM64_RUNNER_ENDPOINT }}
# platforms: linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.REPO_OWNER_LOWERCASE }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ( NodeBB Gosu )
uses: docker/build-push-action@v5
with:
file: gosu.Dockerfile
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
platforms: linux/arm64,linux/amd64
outputs: type=image,push=true
- name: Build and push ( NodeBB )
uses: docker/build-push-action@v5
with:
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64,linux/amd64
outputs: type=image,push=true