-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.82 KB
/
build.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
name: Build and push
on:
push:
branches:
- main
paths-ignore:
- "!.github/**"
- "!app/**"
- "!client/**"
- "!nginx/**"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
- name: Extract metadata for api
id: api
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/short1url-api
ghcr.io/${{ github.repository }}
- name: Build and push api image
uses: docker/build-push-action@v3
with:
context: ./api
push: true
tags: ghcr.io/${{ github.repository }}-api:latest
labels: ${{ steps.api.outputs.labels }}
- name: Extract metadata for client
id: client
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/short1url-client
ghcr.io/${{ github.repository }}
- name: Build and push client image
uses: docker/build-push-action@v3
with:
context: ./client
push: true
tags: ghcr.io/${{ github.repository }}-client:latest
labels: ${{ steps.client.outputs.labels }}