-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GithubActions workflow to push image to DockerHub (#19)
- Loading branch information
1 parent
ce03887
commit fb0dcc9
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: daemon | ||
IMAGE_TAG: ${{ github.ref }} | ||
run: | | ||
docker login --username $DOCKERHUB_API_USERNAME --password $DOCKERHUB_API_TOKEN | ||
docker build -t enjin/$DOCKER_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . | ||
docker push enjin/$DOCKER_REPOSITORY:$IMAGE_TAG |