Skip to content

Commit

Permalink
Merge pull request #812 from opengisch/docker_tags
Browse files Browse the repository at this point in the history
Create docker image tags with commit sha
  • Loading branch information
m-kuhn authored Oct 25, 2023
2 parents 87c18be + 648cc98 commit 03b8180
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- name: Prepare
id: prepare
run: |
VERSION="latest"
TAG=""
TAG="latest"
COMMIT="commit-$(git rev-parse --short ${{ github.sha }})"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
TAG=${GITHUB_REF#refs/tags/v}
fi
TAG=${VERSION}
echo ::set-output name=tag::${TAG}
echo "docker_tag=${TAG}" >> $GITHUB_OUTPUT
echo "docker_commit=${COMMIT}" >> $GITHUB_OUTPUT
git submodule update --init --recursive --depth 1
- name: Set up Docker Buildx
Expand Down Expand Up @@ -61,7 +61,9 @@ jobs:
context: ./docker-app
file: ./docker-app/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: opengisch/qfieldcloud-app:${{ steps.prepare.outputs.tag }}
tags: |
opengisch/qfieldcloud-app:${{ steps.prepare.outputs.docker_tag }}
opengisch/qfieldcloud-app:${{ steps.prepare.outputs.docker_commit }}
- name: Docker Build and Push Worker
id: docker_build_and_push_worker
Expand All @@ -72,7 +74,9 @@ jobs:
context: ./docker-app
file: ./docker-app/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: opengisch/qfieldcloud-worker-wrapper:${{ steps.prepare.outputs.tag }}
tags: |
opengisch/qfieldcloud-worker-wrapper:${{ steps.prepare.outputs.docker_tag }}
opengisch/qfieldcloud-worker-wrapper:${{ steps.prepare.outputs.docker_commit }}
# QGIS
- name: Docker Test QGIS
Expand All @@ -91,12 +95,6 @@ jobs:
context: ./docker-qgis
file: ./docker-qgis/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: opengisch/qfieldcloud-qgis:${{ steps.prepare.outputs.tag }}

- name: Trigger deployment on private repository
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
repository: opengisch/qfieldcloud-private
event-type: public_dispatch
client-payload: '{"version": "${{ steps.prepare.outputs.tag }}"}'
tags: |
opengisch/qfieldcloud-qgis:${{ steps.prepare.outputs.docker_tag }}
opengisch/qfieldcloud-qgis:${{ steps.prepare.outputs.docker_commit }}

0 comments on commit 03b8180

Please sign in to comment.