This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |