forked from traefik/traefik
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.23 KB
/
publish.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
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
name: Build and Publish Container
# yamllint disable-line rule:truthy
on:
pull_request:
push:
branches:
- master
- v*
jobs:
build-webui:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build webui
run: |
make clean-webui generate-webui
tar czvf webui.tar.gz ./webui/static/
- name: Artifact webui
uses: actions/upload-artifact@v3
with:
name: webui.tar.gz
path: webui.tar.gz
publish:
name: Build & Push Container
runs-on: ubuntu-latest
if: github.repository == 'linuxfoundation/traefik'
environment: development
permissions:
contents: read
packages: write
env:
CGO_ENABLED: 0
needs:
- build-webui
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
golang-version: '1.21'
- name: Artifact webui
uses: actions/download-artifact@v3
with:
name: webui.tar.gz
- name: Untar webui
run: tar xvf webui.tar.gz
- name: Build
run: make binary
- name: Login to Registry
id: login-ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/setup-buildx-action@v3
- name: Set Container Metadata
uses: docker/metadata-action@v5
id: meta
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
type=sha
labels: |
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.description=Traefik (LFX Fork)
- name: Build & Push Traefik Container
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
build-args: TARGETPLATFORM=linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true