Merge pull request #488 from Manechat/dependabot/github_actions/actio… #163
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: Docker Image Build | |
on: | |
push: | |
branches: [ "mane" ] | |
workflow_dispatch: | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && github.ref_name == 'mane' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
with: | |
platforms: linux/arm64 | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up ENV | |
id: env | |
run: | | |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV | |
echo "BUILD_COMMIT=$GITHUB_SHA" >> $GITHUB_ENV | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Izzy-Moonbot/Dockerfile | |
push: true | |
tags: ghcr.io/manechat/izzy-moonbot:latest | |
build-args: | | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
BUILD_COMMIT=${{ env.BUILD_COMMIT }} | |
platforms: linux/arm64,linux/amd64 | |
provenance: false |