-
Notifications
You must be signed in to change notification settings - Fork 5
108 lines (104 loc) · 3.56 KB
/
release.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
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Release
on:
push:
branches: ["master"]
tags: ["*"]
workflow_dispatch:
env:
DOCS_URL: https://mogeko.github.io/docker-vlmcsd/vlmcsd.8.pdf
IMAGE_NAME: vlmcsd
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
packages: write
steps:
- uses: actions/[email protected]
- name: Log in to Docker Hub
uses: redhat-actions/[email protected]
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub Container Registry
uses: redhat-actions/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: |
docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
tags: |
type=edge,branch=master,enable={{is_default_branch}}
type=ref,event=tag,enable=true
type=sha,prefix=sha-,format=short,enable=true
labels: |
org.opencontainers.image.documentation=${{ env.DOCS_URL }}
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.vendor=${{ github.actor }}
- name: Setup QEMU
uses: docker/[email protected]
with:
platforms: amd64,arm64
- name: Build container with rootless by Buildah
uses: redhat-actions/[email protected]
id: build-image
with:
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
containerfiles: ./Dockerfile
build-args: |
VLMCSD_VERSION=${{ github.ref_name }}
extra-args: --squash
- name: Push to Container registry
uses: redhat-actions/[email protected]
id: deploy
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
- name: Generate artifact attestation to GitHub Container Registry
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.deploy.outputs.digest }}
push-to-registry: true
man-page:
runs-on: ubuntu-latest
if: ${{ github.ref == format('refs/heads/{0}', 'master') }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: "pages"
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/[email protected]
- run: sudo apt-get update && sudo apt-get -y install groff
- run: make -C ./vlmcsd-* pdfdocs htmldocs
- uses: docker://pandoc/core:3.5.0
with:
args: --from=markdown --output=index.html README.md
- run: |
install -d ./_site && install -t ./_site \
./vlmcsd-*/man/vlmcs*.{pdf,html} ./LICENSE ./index.html
ls -l ./_site
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: "./_site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]