-
-
Notifications
You must be signed in to change notification settings - Fork 29
51 lines (41 loc) · 1.68 KB
/
publish-latest.yml
File metadata and controls
51 lines (41 loc) · 1.68 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
name: "Publish :latest docker tag"
# Trigger the workflow on any commit or merge to the main branch
on:
push:
branches:
- main
- ci/refactore # TODO: remove it
env:
DOCKER_IMAGE_REGISTRY_PATH: nspanelmanager/nspanelmanager
DOCKER_TAG: test # TODO: change it after proper testing (after merge)
jobs:
publish:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get Git commit timestamps
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
- name: Set up QEMU (required for Buildx)
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push multi-arch image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./docker/Dockerfile
# note: platforms list: https://github.com/docker/setup-qemu-action qemu-arm,qemu-aarch64
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
push: true
tags: ${{ env.DOCKER_IMAGE_REGISTRY_PATH }}:${{ env.DOCKER_TAG }}
build-args: |
GITHUB_REF_NAME=${{ github.ref_name }}
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}