-
-
Notifications
You must be signed in to change notification settings - Fork 4
31 lines (25 loc) · 1001 Bytes
/
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
name: Docker Image CI
on:
push:
branches: [ "main" ]
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@v4
- name: Set variables
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT"
- name: Build the Docker image
run: docker build . --file Containerfile --tag vanilla-os/chronos:${{ github.ref_name }}
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
if: github.repository == 'Vanilla-OS/Chronos'
run: |
docker tag vanilla-os/chronos:${{ github.ref_name }} ghcr.io/vanilla-os/chronos:${{ github.ref_name }}
docker login ghcr.io -u ${{ env.REGISTRY_USER }} -p ${{ env.REGISTRY_PASSWORD }}
docker image push "ghcr.io/vanilla-os/chronos:${{ github.ref_name }}"