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

Commit

Permalink
Merge pull request #95 from NCU-Plus/chore/cd
Browse files Browse the repository at this point in the history
Move push image to cd.yml
  • Loading branch information
ppodds authored Sep 16, 2022
2 parents 97fe7ef + cf4ed8a commit 80ab36f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CD

on:
release:
types: [released]

jobs:
test:
uses: ./.github/workflows/test.yml
docker:
needs: test
runs-on: ubuntu-latest
name: "Build Docker image and push to Docker Hub"
steps:
- name: Get version string
id: get-version
run: |
tag=${{github.event.release.tag_name}}
echo "::set-output name=version::${tag:1}"
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ppodds/ncuplus-backend:latest,ppodds/ncuplus-backend:${{ steps.get-version.outputs.version }}
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,3 @@ on:
jobs:
test:
uses: ./.github/workflows/test.yml
docker:
needs: test
runs-on: ubuntu-latest
name: "Build Docker image and push to Docker Hub"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ppodds/ncuplus-backend:latest

0 comments on commit 80ab36f

Please sign in to comment.