-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.14 KB
/
commit.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
name: 'Commit Build'
on:
push:
branches:
- 'main'
- 'development'
- 'rewrite'
jobs:
nightly:
name: Build Docker Image
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUBPAT_TOKEN }}
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Lowercase Repository
shell: bash
run: echo "repo=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
id: lowercase_repository
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ steps.extract_branch.outputs.repo }}:${{ steps.extract_branch.outputs.branch }}