-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (64 loc) · 1.95 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (64 loc) · 1.95 KB
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
name: Github Releaase
on:
push:
paths-ignore:
- '**.md'
- 'extra/**'
- 'capture/**'
- 'ansible/**'
- 'dashboards/**'
- 'scripts/**'
- '.gitignore'
- 'LICENSE'
- '.github/workflows/**'
branches:
- master
permissions:
contents: write
pull-requests: read
env:
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:latest
docker_repo_addr: shayanghani/container-exporter
docker_hub_user: shayanghani
jobs:
release:
outputs:
image_tag: ${{ steps.bump.outputs.new_tag }}
if: github.event_name != 'pull_request' && github.ref_name == 'master'
runs-on: ubuntu-latest
steps:
-
name: Bump version and push tag
id: bump
uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
- name: Create Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
body: ${{ steps.bump.outputs.changelog }}
tag_name: ${{ steps.bump.outputs.new_tag }}
docker-push:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.docker_hub_user }}
password: ${{ secrets.DOCKER_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 Dockerhub
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
"${{env.docker_repo_addr}}:${{ needs.release.outputs.image_tag }}"
"${{env.docker_repo_addr}}:latest"