Skip to content

Commit

Permalink
Github Actions workflow to build and push image to DockerHub (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianFigiel authored Dec 5, 2023
1 parent 6c5c573 commit 206c223
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/push-image-to-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish docker image to DockerHub

on:
workflow_dispatch:

release:
types: [created]

jobs:
push:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Login, build, tag, and push image to DockerHub
env:
DOCKERHUB_API_USERNAME: ${{ secrets.DOCKERHUB_API_USERNAME }}
DOCKERHUB_API_TOKEN: ${{ secrets.DOCKERHUB_API_TOKEN }}
DOCKER_REPOSITORY: platform
IMAGE_TAG: ${{ github.ref_name }}
run: |
docker login --username $DOCKERHUB_API_USERNAME --password $DOCKERHUB_API_TOKEN
docker build -t enjin/$DOCKER_REPOSITORY:$IMAGE_TAG -f configs/core/Dockerfile .
docker push enjin/$DOCKER_REPOSITORY:$IMAGE_TAG

0 comments on commit 206c223

Please sign in to comment.