Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 80ab36f

Browse files
authored
Merge pull request #95 from NCU-Plus/chore/cd
Move push image to cd.yml
2 parents 97fe7ef + cf4ed8a commit 80ab36f

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

.github/workflows/cd.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CD
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
test:
9+
uses: ./.github/workflows/test.yml
10+
docker:
11+
needs: test
12+
runs-on: ubuntu-latest
13+
name: "Build Docker image and push to Docker Hub"
14+
steps:
15+
- name: Get version string
16+
id: get-version
17+
run: |
18+
tag=${{github.event.release.tag_name}}
19+
echo "::set-output name=version::${tag:1}"
20+
- uses: actions/checkout@v2
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
- name: Login to DockerHub
24+
uses: docker/login-action@v2
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
- name: Build and push
29+
uses: docker/build-push-action@v3
30+
with:
31+
push: true
32+
tags: ppodds/ncuplus-backend:latest,ppodds/ncuplus-backend:${{ steps.get-version.outputs.version }}

.github/workflows/ci.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,3 @@ on:
77
jobs:
88
test:
99
uses: ./.github/workflows/test.yml
10-
docker:
11-
needs: test
12-
runs-on: ubuntu-latest
13-
name: "Build Docker image and push to Docker Hub"
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Set up Docker Buildx
17-
uses: docker/setup-buildx-action@v2
18-
- name: Login to DockerHub
19-
uses: docker/login-action@v2
20-
with:
21-
username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
- name: Build and push
24-
uses: docker/build-push-action@v3
25-
with:
26-
push: true
27-
tags: ppodds/ncuplus-backend:latest

0 commit comments

Comments
 (0)