-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.82 KB
/
docker-build-fefenya-image.yml
File metadata and controls
61 lines (54 loc) · 1.82 KB
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
name: Create Fefenya Release Image
# build image only on push to master & specific app directory
on:
push:
branches: [ master ]
paths:
- 'apps/fefenya/**'
- 'package.json'
jobs:
# define job to build and publish docker image
publish:
# run only when code is compiling and tests are passing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.0.2
with:
fetch-depth: 2
- name: Tag new release
uses: butlerlogic/action-autotag@stable
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/alexzedim/fefenya
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{raw}}
labels: |
org.opencontainers.image.title=Fefenya
org.opencontainers.image.vendor=AlexZeDim
org.opencontainers.image.url=https://i.imgur.com/CY0Kqy3.png
org.opencontainers.image.source=https://github.com/AlexZeDim/cmnw-oraculum
- name: Login to Github Packages
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- name: Build & Push (GHCR)
uses: docker/build-push-action@v2.9.0
with:
file: ./apps/fefenya/Dockerfile
push: true
tags: ghcr.io/alexzedim/fefenya:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: |
CR_PAT=${{ secrets.CR_PAT }}
- name: Image digest
run: echo ${{ steps.build-push-action.outputs.digest }}