forked from klakegg/docker-hugo
-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (77 loc) · 2.21 KB
/
build.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
85
86
87
88
89
90
91
92
93
94
95
name: Docker Image build CI
on:
pull_request:
branches:
- master
paths-ignore:
- '.github/**'
push:
branches:
- release/*
paths-ignore:
- '.github/**'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
discussions: write
issues: write
jobs:
build:
runs-on: floryn90-runners
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Clean Workspace
uses: AutoModality/action-clean@v1
- name: Checkout
uses: actions/checkout@v4
- name: Install build essential
uses: ./.github/actions/install_deps
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@v3
with:
username: floryn90
password: ${{ secrets.DOCKER_TOKEN }}
- name: Get previous release tag
id: release_tag
shell: bash
run: |
releases=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/gohugoio/hugo/releases?per_page=1&page=1)
release_tag=$(echo $releases | jq '.[0].tag_name' | sed 's/v//g' | sed 's/"//g')
echo "Latest release tag is ${release_tag}"
echo "latest_release_tag=${release_tag}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.TOKEN_GITHUB }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: floryn90/hugo
- name: Prepare
shell: bash
run: make prepare
- name: Build
shell: bash
run: make build
- name: Upload target content
uses: actions/upload-artifact@v4
with:
name: target
path: target
- name: Push edge images
if: "!startsWith(github.ref, 'refs/tags/')"
shell: bash
run: make push-edge
# - name: Attest
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: 'docker.io/floryn90/hugo'
# subject-name: 'floryn90/hugo'
# push-to-registry: true