Image upgrade #69
This file contains 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: oci-zigbee2mqtt-build | |
env: | |
OCI_APP_NAME: zigbee2mqtt | |
IMAGE_PREFIX: oci- | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Setup QEMU | |
uses: docker/setup-qemu-action@v3 # https://github.com/marketplace/actions/docker-setup-qemu | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 # https://github.com/marketplace/actions/docker-setup-buildx | |
# Enable "Workflow permissions" to "R/W" into https://github.com/thomaschampagne/${repo}/settings/actions | |
- name: Log into GitHub Container Registry | |
uses: docker/login-action@v3 # https://github.com/marketplace/actions/docker-login | |
with: | |
registry: ghcr.io | |
username: ${{ github.action }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set 'ISO' date to "BUILD_DATE" env variable | |
run: echo "BUILD_DATE=$(date -Is)" >> $GITHUB_ENV | |
- name: Set 'YYYYMMDD' date to "BUILD_DATE_SHORT" env variable | |
run: echo "BUILD_DATE_SHORT=$(date +%Y.%m.%d)" >> $GITHUB_ENV | |
# Push to GitHub Container Registry | |
- name: Push to Github Container Registry | |
uses: docker/build-push-action@v5 # https://github.com/marketplace/actions/build-and-push-docker-images | |
with: | |
context: ./${{ env.OCI_APP_NAME }} | |
build-args: | | |
OCI_APP_NAME=${{ env.OCI_APP_NAME}} | |
OCI_REPO_URL=https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}/${{ env.OCI_APP_NAME }} | |
OCI_BUILD_DATE=${{ env.BUILD_DATE }} | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_PREFIX }}${{ env.OCI_APP_NAME }}:latest | |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_PREFIX }}${{ env.OCI_APP_NAME }}:${{ env.BUILD_DATE_SHORT }} |