forked from dchesterton/amcrest2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 2.28 KB
/
publish.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
name: Publish
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- '.github/**'
jobs:
tag:
name: Update tag
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-23.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
docker-publish:
name: Publish to GitHub Container Registry
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-23.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: 'Get Previous tag'
id: tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Write version
uses: DamianReeves/write-file-action@master
with:
path: ./VERSION
contents: |
${{ steps.tag.outputs.tag }}
write-mode: overwrite
- name: Set up QEMU
id: qemu
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm64,linux/armv7
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/[email protected]
with:
context: .
push: true
platforms: ${{ steps.qemu.outputs.platforms }}
tags: |
ghcr.io/danclough/amcrest2mqtt:latest
ghcr.io/danclough/amcrest2mqtt:${{ steps.tag.outputs.tag }}
labels: "version=${{ steps.tag.outputs.tag }}"