-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.37 KB
/
build-and-publish.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
name: Build and Publish Image
on: [push]
jobs:
build:
name: Build and publish image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: farting-lizards/expenses_server_fastapi
- uses: actions/checkout@v4
with:
repository: farting-lizards/expenses-react
- name: Build code
id: build-code
run: |
./build.sh --skip-image-build expenses_server_fastapi expenses_react
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: expenses
tags: latest ${{ github.sha }} ${{ steps.date.outputs.date }}
containerfiles: |
./Dockerfile.prod
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/farting_lizards
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Print image url
run: |
echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"