-
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.
Fixes added to the docker-build-push job
- Loading branch information
1 parent
6a2cbe5
commit 7c86e98
Showing
1 changed file
with
29 additions
and
10 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 |
---|---|---|
|
@@ -4,20 +4,39 @@ on: | |
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: docker/login-action@v1 | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_branches: "main" | ||
- | ||
name: Login to Harbor | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY_URL }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
registry: ${{ secrets.DOCKER_REGISTRY_URL }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
password: ${{ secrets.DOCKER_REGISTRY_PASS }} | ||
|
||
- uses: actions/checkout@v3 | ||
- name: BuildAndPushImageOnHarbor | ||
- | ||
name: Build and push | ||
id: docker_build | ||
env: | ||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY_URL }} | ||
DOCKER_REPOSITORY: breizhcamp/kalon | ||
IMAGE_TAG: ${{ steps.tag_version.outputs.new_version }} | ||
run: | | ||
docker build ./ -t ${{ secrets.DOCKER_REGISTRY_URL }}/breizhcamp/kalon:${{ github.run_number }} | ||
docker push ${{ secrets.DOCKER_REGISTRY_URL }}/breizhcamp/kalon:${{ github.run_number }} | ||
DOCKER_BUILDKIT=1 docker build -t $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG -t $DOCKER_REGISTRY/$DOCKER_REPOSITORY:latest . | ||
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG | ||
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:latest | ||
- | ||
name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |