Skip to content

Commit 31eb17f

Browse files
committed
ci: run docker release only if tag is pushed
1 parent 03da681 commit 31eb17f

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/release-automated.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
jobs:
66
release:
77
runs-on: ubuntu-latest
8+
outputs:
9+
current_tag: ${{ steps.tag.outputs.current_tag }}
810
steps:
911
- uses: actions/checkout@v2
1012
with:
@@ -26,9 +28,13 @@ jobs:
2628
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
2729
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2830
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
- name: Determine tag on current commit
32+
id: tag
33+
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0 --exact-match || echo '')"
2934

3035
docker:
3136
needs: release
37+
if: needs.release.outputs.current_tag != ''
3238
env:
3339
REGISTRY: docker.io
3440
IMAGE_NAME: parseplatform/parse-dashboard

.github/workflows/release-manual-docker.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
1-
name: release-manual-docker
1+
# Trigger this workflow only to manually create a Docker release; this should only be used
2+
# in extraordinary circumstances, as Docker releases are normally created automatically as
3+
# part of the automated release workflow.
24

3-
# Use this only in extraordinary circumstances to manually create a Docker release.
4-
# A Docker release is normally created as part of the automated release workflow.
5+
name: release-manual-docker
56
on: workflow_dispatch
6-
77
env:
88
REGISTRY: docker.io
99
IMAGE_NAME: parseplatform/parse-dashboard
10-
1110
jobs:
1211
build:
13-
1412
runs-on: ubuntu-18.04
1513
permissions:
1614
contents: read
1715
packages: write
18-
1916
steps:
2017
- name: Determine branch name
2118
id: branch
2219
run: echo "::set-output name=branch_name::${GITHUB_REF#refs/*/}"
23-
2420
- name: Checkout repository
2521
uses: actions/checkout@v2
26-
2722
- name: Set up QEMU
2823
id: qemu
2924
uses: docker/setup-qemu-action@v1
30-
3125
- name: Set up Docker Buildx
3226
uses: docker/setup-buildx-action@v1
33-
3427
- name: Log into Docker Hub
3528
if: github.event_name != 'pull_request'
3629
uses: docker/login-action@v1
3730
with:
3831
username: ${{ secrets.DOCKERHUB_USERNAME }}
3932
password: ${{ secrets.DOCKERHUB_TOKEN }}
40-
4133
- name: Extract Docker metadata
4234
id: meta
4335
uses: docker/metadata-action@v3
4436
with:
4537
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4638
flavor: |
4739
latest=${{ steps.branch.outputs.branch_name == 'master' }}
48-
4940
- name: Build and push Docker image
5041
uses: docker/build-push-action@v2
5142
with:

0 commit comments

Comments
 (0)