Skip to content

Commit

Permalink
Simple GHCR Push action
Browse files Browse the repository at this point in the history
  • Loading branch information
Dletta committed Jul 31, 2024
1 parent 173080a commit 2d68d18
Showing 1 changed file with 2 additions and 48 deletions.
50 changes: 2 additions & 48 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,11 @@ jobs:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check Docker secret presence
id: checkdocker
shell: bash
run: |
if [ "$SECRET" == "" ]; then
echo "secretspresent=false" >> $GITHUB_OUTPUT
else
echo "secretspresent=true" >> $GITHUB_OUTPUT
fi
env:
SECRET: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker QEMU
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: amd64, arm64
- name: Set up Docker Buildx
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]

- name: Login to DockerHub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to Docker Hub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
push: true
tags: |
qxip/speech2hep:latest
qxip/speech2hep:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
qxip/speech2hep:latest
qxip/speech2hep:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
labels: |
dev.speech2hep.image.title=speech2hep
dev.speech2hep.image.type=nodejs
dev.speech2hep.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
- name: Log in to the GHCR registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push to GHCR
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
platforms: linux/amd64
file: ./Dockerfile
push: true
tags: |
Expand Down

0 comments on commit 2d68d18

Please sign in to comment.