Skip to content

Commit

Permalink
Fixing Docker Hub publishes (#7)
Browse files Browse the repository at this point in the history
* Updating conditional to build-and-push Github workflow

* Fixing 'on push' triggers in Github build job

* Adding proper wildcard matching using regex

* Fixing up github expressoins

* One more fix.. for real this time.

* Adding a missing character...

* Updating auto-release to use public Github access token

* Finalizing a few things...

* Fixing github.event.release.action

* Fixing github.event.release.action

* Fixing github.event.release.action

* Fixing github.event.release.action

* More testing

* Final logic tweaks

* Fixing YAML formatting

Co-authored-by: Dan Meyers <[email protected]>
  • Loading branch information
danjbh and danjbh authored Sep 15, 2020
1 parent b6b7d40 commit 0880e37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
9 changes: 3 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: "docker"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
release:
Expand All @@ -15,7 +12,7 @@ jobs:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- name: Prepare tags for Docker image
if: (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
id: prepare
run: |
TAGS=${{ github.repository }}:sha-${GITHUB_SHA:0:7}
Expand All @@ -34,7 +31,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -43,5 +40,5 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository }}
push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.prepare.outputs.tags }}

0 comments on commit 0880e37

Please sign in to comment.