Skip to content

Commit 03da681

Browse files
committed
ci: adding docker release to releae automation
1 parent 2114173 commit 03da681

File tree

3 files changed

+75
-39
lines changed

3 files changed

+75
-39
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: release-automated
2+
on:
3+
push:
4+
branches: [ master, alpha, beta, next-major ]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
persist-credentials: false
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 12
15+
registry-url: https://registry.npmjs.org/
16+
- name: Cache Node.js modules
17+
uses: actions/cache@v2
18+
with:
19+
path: ~/.npm
20+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-node-
23+
- run: npm ci
24+
- run: npx semantic-release
25+
env:
26+
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
30+
docker:
31+
needs: release
32+
env:
33+
REGISTRY: docker.io
34+
IMAGE_NAME: parseplatform/parse-dashboard
35+
runs-on: ubuntu-18.04
36+
permissions:
37+
contents: read
38+
packages: write
39+
steps:
40+
- name: Determine branch name
41+
id: branch
42+
run: echo "::set-output name=branch_name::${GITHUB_REF#refs/*/}"
43+
- name: Checkout repository
44+
uses: actions/checkout@v2
45+
- name: Set up QEMU
46+
id: qemu
47+
uses: docker/setup-qemu-action@v1
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v1
50+
- name: Log into Docker Hub
51+
if: github.event_name != 'pull_request'
52+
uses: docker/login-action@v1
53+
with:
54+
username: ${{ secrets.DOCKERHUB_USERNAME }}
55+
password: ${{ secrets.DOCKERHUB_TOKEN }}
56+
- name: Extract Docker metadata
57+
id: meta
58+
uses: docker/metadata-action@v3
59+
with:
60+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
61+
flavor: |
62+
latest=${{ steps.branch.outputs.branch_name == 'master' }}
63+
- name: Build and push Docker image
64+
uses: docker/build-push-action@v2
65+
with:
66+
context: .
67+
platforms: linux/amd64
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: ${{ steps.meta.outputs.tags }}
70+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/docker-publish.yml renamed to .github/workflows/release-manual-docker.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
name: docker
2-
3-
on:
4-
# Disabled as we move to new branch model and plan to change the `latest` tag to mean "latest stable" instead of as currently "latest unstable"
5-
# schedule:
6-
# # Nightly builds capture upstream updates to dependency images such as node.
7-
# - cron: '19 17 * * *'
8-
push:
9-
# Disabled as we move to new branch model and plan to change the `latest` tag to mean "latest stable" instead of as currently "latest unstable"
10-
# branches: [ master ]
11-
tags: [ '*.*.*' ]
1+
name: release-manual-docker
2+
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+
on: workflow_dispatch
126

137
env:
148
REGISTRY: docker.io

.github/workflows/release.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)