-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (63 loc) · 1.95 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
name: Build Docker Image
on:
push:
tags:
- 'v*'
workflow_run:
workflows: ["Tests"]
branches: [master]
types:
- completed
jobs:
release:
name: Release GitHub tag
runs-on: 'ubuntu-latest'
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
default_bump: minor
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
push:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to GitHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_REGISTRY_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push to GitHub
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/omegion/db-backup:latest,ghcr.io/omegion/db-backup:${{ needs.release.outputs.new_tag }}
platforms: linux/amd64,linux/arm64
build-args: VERSION=${{ needs.release.outputs.new_tag }}