-
Notifications
You must be signed in to change notification settings - Fork 11
39 lines (32 loc) · 1 KB
/
docker-image.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
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "master" ]
env:
REPO_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Checkout git submodules too
run: git submodule sync && git submodule update --init
- # Activate cache export feature to reduce build time of images
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: define image name from repo name
run: echo "IMAGE_NAME=ghcr.io/${REPO_NAME,,}" >> $GITHUB_ENV
- name: Build the Docker image
run: make docker DOCKER_TAG=${{ env.IMAGE_NAME }}
- name: Push to Github Container Registry
run: docker push ${{ env.IMAGE_NAME }}