Skip to content

Commit

Permalink
Github Action to push container
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Sep 15, 2023
1 parent 029d06f commit fe2a75e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Push Docker Container

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

env:
IMAGE_VERSION: v2.8.2

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Build and push multi-platform Docker image
run: |
# Build and tag the Docker image with the version
docker buildx create --use
docker buildx build --push \
--tag ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ env.IMAGE_VERSION }} \
--platform linux/amd64,linux/arm64 .
env:
DOCKER_CLI_ACI_AS_TEXT: "true"

0 comments on commit fe2a75e

Please sign in to comment.