-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to publish the Docker image
- Loading branch information
1 parent
e1e6b58
commit 86fa5fc
Showing
2 changed files
with
69 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,56 @@ | ||
name: Publish Docker image | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
IMAGE_TAG: docker.io/botsudo/docker-openldap:latest | ||
|
||
jobs: | ||
push_to_registry: | ||
environment: | ||
name: Docker Hub | ||
url: https://hub.docker.com/r/botsudo/docker-openldap | ||
name: Push Docker image to DockerHub and GitHub Container Registry | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} | ||
password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} | ||
|
||
- name: Build image | ||
run: make docker-build | ||
- name: Test image | ||
run: make test | ||
|
||
#- name: Sign and push docker image | ||
# uses: sudo-bot/action-docker-sign@latest | ||
# with: | ||
# image-ref: "docker.io/botsudo/action-docker-compose:latest" | ||
# private-key-id: "${{ secrets.DOCKER_PRIVATE_KEY_ID }}" | ||
# private-key: ${{ secrets.DOCKER_PRIVATE_KEY }} | ||
# private-key-passphrase: ${{ secrets.DOCKER_PRIVATE_KEY_PASSPHRASE }} | ||
|
||
- name: Push to GHCR | ||
run: make docker-push | ||
- name: Tag for GHCR | ||
run: make docker-tag-ghcr | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push to GitHub Container Registry | ||
run: make docker-push-ghcr |
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