Skip to content

Commit

Permalink
updated action
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbolton committed Sep 24, 2023
1 parent 98d3789 commit 925e160
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 19 deletions.
49 changes: 30 additions & 19 deletions .github/workflows/github-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
name: gh-ci
name: Build and Push Container

on:
push:
branches:
- 'main'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
- main

jobs:
build:
build-and-push:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Publish Docker Image
# You may pin to the exact commit or the version.
# uses: elgohr/Publish-Docker-Github-Action@191af57e15535d28b83589e3b5f0c31e76aa8733
uses: elgohr/[email protected]
with:
# The name of the image you would like to push
name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Containers
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
27 changes: 27 additions & 0 deletions github-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: gh-ci

on:
push:
branches:
- 'main'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Publish Docker Image
# You may pin to the exact commit or the version.
# uses: elgohr/Publish-Docker-Github-Action@191af57e15535d28b83589e3b5f0c31e76aa8733
uses: elgohr/[email protected]
with:
# The name of the image you would like to push
name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}

0 comments on commit 925e160

Please sign in to comment.