This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from AMRC-FactoryPlus/acs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 2.35 KB
/
deploy-main.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
name: Deploy Main
on:
pull_request:
types:
- closed
branches:
- 'main'
jobs:
retag-backend:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag Backend
run: |
TIMESTAMP=$(date +%s)
docker pull ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-backend
docker tag ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-backend ghcr.io/amrc-factoryplus/acs-manager:main-backend
docker push ghcr.io/amrc-factoryplus/acs-manager:main-backend
docker tag ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-backend ghcr.io/amrc-factoryplus/acs-manager:main-${{ github.event.pull_request.number }}-backend-$TIMESTAMP
docker push ghcr.io/amrc-factoryplus/acs-manager:main-${{ github.event.pull_request.number }}-backend-$TIMESTAMP
retag-frontend:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag Frontend
run: |
TIMESTAMP=$(date +%s)
docker pull ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-frontend
docker tag ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-frontend ghcr.io/amrc-factoryplus/acs-manager:main-frontend
docker push ghcr.io/amrc-factoryplus/acs-manager:main-frontend
docker tag ghcr.io/amrc-factoryplus/acs-manager:pr-${{ github.event.pull_request.number }}-frontend ghcr.io/amrc-factoryplus/acs-manager:main-${{ github.event.pull_request.number }}-frontend-$TIMESTAMP
docker push ghcr.io/amrc-factoryplus/acs-manager:main-${{ github.event.pull_request.number }}-frontend-$TIMESTAMP