-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
126b9d4
commit 451cc1c
Showing
3 changed files
with
40 additions
and
40 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 |
---|---|---|
|
@@ -19,4 +19,4 @@ changelog: | |
- deprecated | ||
- title: Other Changes | ||
labels: | ||
- "*" | ||
- "*" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,28 +1,55 @@ | ||
name: Docker CI (release) | ||
name: Docker Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- dev | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_REGISTRY: ghcr.io | ||
IMAGE_PATH: ${{ github.repository }} | ||
IMAGE_TAG: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
- name: Get latest release | ||
id: latest_release | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
repository: ${{ github.repository }} | ||
excludes: prerelease, draft | ||
- name: Docker Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push docker | ||
run: | | ||
docker build -f ./Dockerfile . --tag ${{ env.REGISTRY }}/fsr5-fhaachen/portals:${{ env.RELEASE_VERSION }} --tag ${{ env.REGISTRY }}/fsr5-fhaachen/portals:latest | ||
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/portals:${{ env.RELEASE_VERSION }} | ||
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/portals:latest | ||
- name: Build and push (latest release) | ||
uses: docker/build-push-action@v4 | ||
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release | ||
with: | ||
push: true | ||
tags: | ||
- ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} | ||
- ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest | ||
- name: Build and push (release) | ||
uses: docker/build-push-action@v4 | ||
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest) | ||
with: | ||
push: true | ||
tags: | ||
- ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} | ||
- name: Build and push (push) | ||
uses: docker/build-push-action@v4 | ||
if: ${{ github.event_name == 'push' }} # run only on push (to dev) | ||
with: | ||
push: true | ||
tags: | ||
- ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} |