Skip to content

Commit

Permalink
Update container publish action to GHCR
Browse files Browse the repository at this point in the history
Aswell as general update inline with template
  • Loading branch information
connorhsm committed Apr 12, 2023
1 parent f53a0e6 commit 3e29d59
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: Publish Docker Image
name: Publish container

on:
push:
branches:
- master
release:
types: [published]

jobs:
docker-hub-push:
name: Push Docker image to Docker Hub
publish-ghcr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
- name: Gather metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: zetifi/docker-irestarter
images: ghcr.io/zetifi/docker-irestarter
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
Expand All @@ -29,18 +27,20 @@ jobs:
with:
platforms: linux/arm64/v8,linux/amd64

- name: Log in to Docker Hub
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.github_token }}

- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}, zetifi/docker-irestarter:latest
labels: ${{ steps.meta.outputs.labels }}
context: .
platforms: linux/arm64/v8,linux/amd64
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}, ghcr.io/zetifi/docker-irestarter:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 3e29d59

Please sign in to comment.