-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (34 loc) · 1.1 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CD
on:
release:
types: [released]
jobs:
docker:
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 frontend and push
uses: docker/build-push-action@v3
with:
context: ./apps/frontend
push: true
tags: ppodds/brick-trader-frontend:latest,ppodds/brick-trader-frontend:${{ steps.get-version.outputs.version }}
- name: Build backend and push
uses: docker/build-push-action@v3
with:
context: ./apps/backend
push: true
tags: ppodds/brick-trader-backend:latest,ppodds/brick-trader-backend:${{ steps.get-version.outputs.version }}