-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (52 loc) · 1.73 KB
/
cron.multiple.image+upload.yaml
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
name: Deploy to Amazon ECR Multiple Cron
on:
push:
branches:
- baobab
paths:
- "cron/multiple/*"
env:
ecr_url: public.ecr.aws/u6t6w0e4/orakl-general
jobs:
prepare:
name: Prepare Build
runs-on: ubuntu-latest
outputs:
pre_fix: cron
tag_date: ${{ steps.tag.outputs.date }}
tag_git_hash: ${{ steps.tag.outputs.git_hash }}
steps:
- uses: actions/checkout@v3
- name: Get time TAG
id: tag
run: |
echo "date=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT
echo "git_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
build:
name: Build
runs-on: ubuntu-latest
needs: prepare
permissions:
id-token: write
contents: read
outputs:
tag_date: ${{ steps.tag.outputs.date }}
tag_git_hash: ${{ steps.tag.outputs.git_hash }}
steps:
- uses: actions/checkout@v3
- name: Docker build orakl-cron
run: docker-compose -f cron/multiple/docker-compose.build.yaml build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.ROLE_ARN }}
- name: Login to Amazon ECR
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
- name: Publish Image to ECR(orakl)
run: |
docker tag orakl-general ${{ env.ecr_url }}:${{ needs.prepare.outputs.pre_fix }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}
docker push ${{ env.ecr_url }}:${{ needs.prepare.outputs.pre_fix }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}