-
-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (43 loc) · 1.43 KB
/
docker.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
44
name: Docker CI/CD
on:
pull_request:
branches: ['**']
paths:
- lunchable/**
- pyproject.toml
- .github/workflows/docker.yaml
- Dockerfile
jobs:
docker-ci-test:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
hatch --version
- name: Declare Version Variable
run: |
PACKAGE_VERSION=$(hatch version)
PACKAGE_NAME=$(hatch project metadata | jq -r .name)
echo PACKAGE_VERSION=${PACKAGE_VERSION} >> $GITHUB_ENV
echo PACKAGE_NAME=${PACKAGE_NAME} >> $GITHUB_ENV
- name: Docker Image Building and Publishing
id: docker_build
uses: docker/build-push-action@v3
with:
push: false
tags: juftin/${{ env.PACKAGE_NAME }}:latest