-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 1.92 KB
/
docker-image.yml
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
name: Docker Image CI
on: # yamllint disable-line rule:truthy
push:
branches: ["master"]
jobs:
build:
runs-on: arc-runner-hetzner-k3s-docs
steps:
- name: Install git
run: sudo apt-get update && sudo apt-get install -y git
- name: Check out main repository
uses: actions/checkout@v4
with:
submodules: true
- name: Check out aux repository 1
uses: actions/checkout@v4
with:
repository: ilyannn/publish-secret-docs
path: build/publish-secret-docs
token: ${{ secrets.TOKEN_READ_MEGAVERSE_CONFIG }}
- name: Check out aux repository 2
uses: actions/checkout@v4
with:
repository: ilyannn/hetzner-k3s-main
path: build/hetzner-k3s-main
token: ${{ secrets.TOKEN_READ_MEGAVERSE_CONFIG }}
- name: Login to Cluster Registry
uses: docker/login-action@v3
with:
registry: registry.cluster.megaver.se
username: robot$github
password: ${{ secrets.HARBOR_TOKEN_ROBOT_GITHUB }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Produce all tags
uses: docker/metadata-action@v5
id: meta
with:
images: registry.cluster.megaver.se/library/hetzner-k3s-docs-webserver
tags: |
type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=run-${{ github.run_number }}-${{ github.run_attempt }}
- name: Build and push the Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}