Skip to content

Commit

Permalink
ci: build docker only when secrets are present
Browse files Browse the repository at this point in the history
Fix: use direct comparison instead of strings.Contains to filter layernames

chore: fix inaccessible secrets

chore: fix invalid mapping
  • Loading branch information
iwpnd committed Jul 3, 2024
1 parent c7296fd commit 7368dc9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/on_release_publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: On release publish
on:
push:
pull_request:
push:
branches:
- master
release:
types: [published]

jobs:

gen_version:
name: Generate software version
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -223,6 +224,8 @@ jobs:
needs: [gen_version,build_ui]
runs-on: ubuntu-22.04
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_ORG: gospatial
DOCKERHUB_REPO: tegola
BUILD_ARGS: |
Expand All @@ -243,6 +246,7 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v3
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != ''
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -259,6 +263,7 @@ jobs:
# we are not rebuilding linux/amd64
- name: Build docker image for testing
uses: docker/build-push-action@v5
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != ''
with:
context: .
load: true
Expand All @@ -267,6 +272,7 @@ jobs:
tags: ${{ env.DOCKERHUB_ORG }}/${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}

- name: Test image build
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != ''
run: |
docker run --rm ${DOCKERHUB_ORG}/${DOCKERHUB_REPO}:${VERSION} version
Expand Down

0 comments on commit 7368dc9

Please sign in to comment.