-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 1.7 KB
/
fe-notification-center-dockerize.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
name: Dockerizing Subsbase Notification Center Frontend
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- frontend/**
jobs:
setup:
runs-on: ubuntu-latest
name: Setup
outputs:
short-sha: ${{steps.short-sha.outputs.short-sha}}
image-name: ${{steps.image-name.outputs.image-name}}
steps:
- id: image-name
run: echo "::set-output name=image-name::notification-center"
- id: short-sha
run: echo "::set-output name=short-sha::$(echo '${{ github.sha }}' | cut -c 1-7)"
build_and_push_image:
runs-on: ubuntu-latest
name: Build and Push Image
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Image meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/subsbase/${{ needs.setup.outputs.image-name }}
# generate Docker tags
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
${{ needs.setup.outputs.short-sha }}
latest
- name: Log in to ghcr
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}