-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.12 KB
/
publish-to-dc.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
name: build--and-publish-docker-image
run-name: Build and push Docker image to GitHub Container Registry
on:
push:
branches:
- main
paths:
- 'backend-api/**'
jobs:
build-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout source code
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: cd backend-api && npm install
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Get current date
id: date
run: echo "date=$(date +%s)" >>$GITHUB_OUTPUT
- name: Build and publish Docker Images backend-api to GitHub Container registry
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GPAT }}
image-name: backend-api
build-context: ./backend-api
dockerfile: Dockerfile
image-tag: ${{ steps.branch-name.outputs.current_branch }}-${{ github.sha }}-${{ steps.date.outputs.date }}