-
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.
* Allowing docker builds on branches -> useful for testing * Adding delete docker image workflow for when a branch not main is deleted
- Loading branch information
Carolyn Russell
committed
Apr 8, 2021
1 parent
4888dde
commit 18e8e30
Showing
2 changed files
with
58 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Delete branch docker | ||
# Deletes the docker associated with the branch | ||
|
||
on: | ||
delete: | ||
branches: | ||
- '!main' | ||
|
||
jobs: | ||
delete: | ||
if: github.event.ref_type == 'branch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Clean up | ||
run: echo "Clean up for branch ${{ github.event.ref }}" | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=provenanceio/explorer-service | ||
VERSION=$(echo ${github.event.ref} | sed -r 's#/+#-#g') | ||
echo ::set-output name=version::${VERSION} | ||
- name: Delete branch docker | ||
uses: m3ntorship/[email protected] | ||
id: delete_old_tags | ||
with: | ||
token: ${{secrets.DOCKERHUB_TOKEN}} | ||
keep-last: 50 | ||
user: ${{ secrets.DOCKERHUB_USERNAME }} | ||
repos: '["provenanceio/explorer-service"]' | ||
substrings: '[${{ steps.prep.outputs.version }}]' |
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