-
-
Notifications
You must be signed in to change notification settings - Fork 209
91 lines (87 loc) · 2.73 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
name: Release
on:
push:
branches: [ main ]
tags-ignore:
- 'v*'
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build .
integration-test-github:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
if: ${{ github.actor != 'dependabot[bot]' }}
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: ghcr.io/elgohr/publish-docker-github-action/publish-docker-github-action
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
integration-test-dockerhub:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
if: ${{ github.actor != 'dependabot[bot]' }}
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: lgohr/publish-docker-github-action
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
tag_names: true
integration-test-multi-arch:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx for Multi-Arch Build
uses: docker/setup-buildx-action@v3
- name: Publish to Registry
if: ${{ github.actor != 'dependabot[bot]' }}
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: ghcr.io/elgohr/publish-docker-github-action/multi-arch-publish-docker-github-action
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
platforms: linux/amd64,linux/arm64
dockerfile: testdata/Multi-Arch-Dockerfile
release:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs:
- test
- integration-test-github
- integration-test-dockerhub
- integration-test-multi-arch
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUBLISH_TOKEN }} # for pushing to protected branch
- name: Publish new version
run: |
git config --global user.email "no_reply@gohr.digital"
git config --global user.name "Release Bot"
git tag -fa v5 -m "Update v5 tag"
git push origin v5 --force