Repository navigation
90 lines (72 loc) · 2.08 KB
/
Copy pathdocker.yml
File metadata and controls
90 lines (72 loc) · 2.08 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Docker
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
jobs:
docker:
name: Docker
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
env:
USER: mro
APP: evora-server
steps:
- uses: actions/checkout@v6
- name: Download SDK zip file
run: |
curl -L -o andor.zip ${{ secrets.ANDOR_SDK_LINK }}
- name: Extract SDK
run: |
rm -Rf andor
unzip andor.zip -d andor_tmp
mv andor_tmp/andor ./
rm -Rf andor.zip andor_tmp
- name: List files
run: |
ls
- name: List Andor SDK files
run: |
ls andor
- name: Set docker tags
id: set-tags
run: |
if [[ $GITHUB_REF == refs/heads/main ]]
then
echo TAGS=$USER/$APP:latest >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/* ]]
then
BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's/[\/]/_/g')
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/pull/* ]]
then
BRANCH=${{ github.head_ref || github.ref_name }}
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
else
echo TAGS=$USER/$APP:${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
fi
- name: Show tags
run: echo ${{ steps.set-tags.outputs.TAGS }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
tags: ghcr.io/${{ steps.set-tags.outputs.TAGS }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}