-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making Docker push only if Dockerfile changed (#10)
- Loading branch information
1 parent
52c5903
commit 430acd2
Showing
2 changed files
with
34 additions
and
13 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
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,34 @@ | ||
name: Docker build of nginx-keycloak | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'Dockerfile' | ||
|
||
jobs: | ||
|
||
docker-build: | ||
name: Ubuntu 22.04 build of nginx-keycloak | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
|
||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker-compose build | ||
run: | | ||
docker compose build | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push nginx image to GitHub Container Registry | ||
run: | | ||
docker push ghcr.io/flavienbwk/nginx-keycloak/nginx-sso:$(grep -oP "(?<=image: ghcr.io/flavienbwk/nginx-keycloak/nginx-sso:).*" docker-compose.yml) |