-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.04 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
name: Docker Image CI
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "dev" ]
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
if: ${{ !contains(github.event.head_commit.message, '(skip)') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set variables
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT"
- name: Build the Docker image
run: |
sh prepare.sh
cd $HOME/nodebb
docker build . --file Dockerfile --tag fabricatorsltd/nodebb:${{ github.ref_name }}
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
run: |
docker tag fabricatorsltd/nodebb:${{ github.ref_name }} ghcr.io/fabricatorsltd/nodebb:${{ github.ref_name }}
docker login ghcr.io -u ${{ env.REGISTRY_USER }} -p ${{ env.REGISTRY_PASSWORD }}
docker image push "ghcr.io/fabricatorsltd/nodebb:${{ github.ref_name }}"