-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 1 KB
/
docker.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: Build Docker Image
on:
workflow_run:
workflows: ["Version"]
types:
- completed
env:
REGISTRY: ghcr.io
SUBPATH: 42nerds
IMAGE_NAME: hitchhiker
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: log into ghcr.io
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get hitchhiker version
id: version
run: |
export VERSION=$(sed -n 's/^_hitchhiker_version = "\(.*\)"/\1/p' setup.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.SUBPATH }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}