-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.53 KB
/
frontend.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
name: frontend
on:
push:
branches: [main]
paths:
- 'frontend/**'
# tags:
# - 'frontend*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Gitlab
uses: docker/login-action@v1
with:
registry: gitlab.xgridcolo.com:5050
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_PASSWORD }}
- name: build, tag, and push image to gitlab ECR
env:
ECR_REGISTRY: gitlab.xgridcolo.com:5050/ecr
ECR_REPOSITORY: whisper-front-staging
IMAGE_TAG: ${{ github.sha }}
run: |
ls
cd frontend
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile .
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Checkout argocd
uses: actions/checkout@v2
with:
repository: teamsmiley/argocd-c3
token: ${{ secrets.PAT }}
- name: replace image version number to sha
run: |
cd apps/whisper-staging
sed "s/:latest/:${{ github.sha }}/g" 32.www.origin > 32.www.yml
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "push new tag"
git push