Update README.md #11
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 Build/Publish Image | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_IMAGE: ryanconnell/concert-watch | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_TARGET_PLATFORM: linux/arm/v7 | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: crazy-max/ghaction-docker-buildx@v1 | |
with: | |
version: latest | |
- name: Prepare | |
if: success() | |
id: prepare | |
run: | | |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} | |
echo ::set-output name=docker_image::${DOCKER_IMAGE} | |
echo ::set-output name=version::${GITHUB_RUN_NUMBER} | |
- name: Docker Login | |
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Run Buildx (push image) | |
if: success() | |
run: | | |
docker buildx build \ | |
--platform ${{ steps.prepare.outputs.docker_platform }} \ | |
--platform linux/amd64 \ | |
--tag ${{ steps.prepare.outputs.docker_image }}:$(git rev-parse --short "$GITHUB_SHA") \ | |
--tag ${{ steps.prepare.outputs.docker_image }}:latest \ | |
--file ./Dockerfile \ | |
--output type=image,push=true . |