-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (37 loc) · 1.2 KB
/
release.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
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
bin: ["dorafactory-node"]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Build image
env:
PROFILE: "release"
run: |
docker build --build-arg BIN=${{ matrix.bin }} --build-arg PROFILE=$PROFILE -t dorafactory-node:local -f ./Dockerfile .
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASS }}
- name: Get Tag Name
if: startsWith(github.ref, 'refs/tags/')
id: git_tag
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
- name: Tag, push image to Amazon ECR
env:
REGISTRY: dorafactory
REPOSITORY: dorafactory-node
IMAGE_TAG: ${{ steps.git_tag.outputs.tag }}
run: |
docker tag dorafactory-node:local $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG