-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (82 loc) · 3.45 KB
/
publish.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build - publish
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ECR_REPOSITORY_URL: 673156464838.dkr.ecr.us-west-2.amazonaws.com
ECR_REPOSITORY_NAME_SERVER: on-chain-voting-server
ECR_REPOSITORY_NAME_WEB: on-chain-voting-web
jobs:
publish-server-image:
name: Build and Push Docker Image
runs-on: minafoundation-default-runners
steps:
- name: 📥 Checkout
uses: actions/checkout@v3
- name: 🦀 Get on-chain-voting server version from Cargo.toml.
id: ocv-server
uses: dante-signal31/[email protected]
with:
cargo_toml_folder: ./server/
- name: 🏷️ Generate Tag
run: echo "TAG_SERVER=${{ steps.ocv-server.outputs.app_version }}" >> $GITHUB_ENV
- name: 🔑 ECR Login
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 🔍 Check if Tag already exists
id: checktag
uses: tyriis/docker-image-tag-exists@main
with:
registry: ${{ env.ECR_REPOSITORY_URL}}
repository: ${{ env.ECR_REPOSITORY_NAME_SERVER }}
tag: ${{ env.TAG_SERVER }}
- name: 🛠️ Build on-chain-voting server Docker Image
if: steps.checktag.outputs.tag == 'not found'
working-directory: ./server/
run: DOCKER_BUILDKIT=1 docker build -t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME_SERVER }}:${{ env.TAG_SERVER }} .
- name: 🚚 Push on-chain-voting server Docker Image
if: steps.checktag.outputs.tag == 'not found'
run: docker push ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME_SERVER }}:${{ env.TAG_SERVER }}
- name: 📝 Release Notes
run: |
echo "Generate Release Notes"
echo "TODO: Generate Release Notes (https://github.com/MinaProtocol/mf-devops-workflows/issues/23)"
publish-web-image:
name: Build and Push Docker Image
runs-on: minafoundation-default-runners
steps:
- name: 📥 Checkout
uses: actions/checkout@v3
- name: 🦀 Get on-chain-voting web version from package.json
id: ocv-web
uses: martinbeentjes/[email protected]
with:
path: web
- name: 🏷️ Generate Tag
run: echo "TAG_WEB=${{ steps.ocv-web.outputs.current-version }}" >> $GITHUB_ENV
- name: 🔑 ECR Login
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 🔍 Check if Tag already exists
id: checktag
uses: tyriis/docker-image-tag-exists@main
with:
registry: ${{ env.ECR_REPOSITORY_URL}}
repository: ${{ env.ECR_REPOSITORY_NAME_WEB }}
tag: ${{ env.TAG_WEB }}
- name: 🛠️ Build on-chain-voting web Docker Image
if: steps.checktag.outputs.tag == 'not found'
working-directory: ./web/
run: DOCKER_BUILDKIT=1 docker build -t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME_WEB }}:${{ env.TAG_WEB }} .
- name: 🚚 Push on-chain-voting web Docker Image
if: steps.checktag.outputs.tag == 'not found'
run: docker push ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME_WEB }}:${{ env.TAG_WEB }}
- name: 📝 Release Notes
run: |
echo "Generate Release Notes"
echo "TODO: Generate Release Notes (https://github.com/MinaProtocol/mf-devops-workflows/issues/23)"