-
Notifications
You must be signed in to change notification settings - Fork 36
72 lines (68 loc) · 2.53 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
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
name: Tinyphone Docker Build
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types:
- labeled
branches:
- master
jobs:
tinyphone_docker_job:
if: github.event.label.name == 'ci/github' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
name: Build Tinyphone
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '1'
submodules: 'recursive'
- name: Disable IPv6
shell: bash -l {0}
run: echo "DISABLE_IPV6=1" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
- name: Get Changed Files
uses: jitterbit/get-changed-files@v1
if: github.event_name != 'workflow_dispatch'
id: changed_files
with:
format: 'space-delimited'
continue-on-error: true
- name: Set vars
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and Push tinyphone_base to registry
if: contains(steps.changed_files.outputs.modified, 'Dockerfile.base')
run: |
docker build --file=./distribution/docker/Dockerfile.base -t ghcr.io/${{ github.repository_owner }}/tinyphone_base:vc2019 -t ghcr.io/${{ github.repository_owner }}/tinyphone_base:${{ steps.vars.outputs.sha_short }} ./distribution/docker
docker push ghcr.io/${{ github.repository_owner }}/tinyphone_base:vc2019
- name: Update CodeDir
run : |
sed -i 's/$env:CodeDir/C:\\Code\\tinyphone/g' ./distribution/docker/release.ps1
cat ./distribution/docker/release.ps1
shell : bash
- name: Build tinyphone
run: |
cat ./distribution/docker/release.ps1 | docker run -v ${PWD}:"C:\Code\tinyphone" -i ghcr.io/${{ github.repository_owner }}/tinyphone_base:vc2019
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: tinyphone_installer
path: |
./tinyphone-installer/bin/Release/tinyphone_installer.msi
# - name: Create Release
# uses: ncipollo/release-action@v1
# if: startsWith(github.ref, 'refs/tags/v')
# with:
# artifacts: "./tinyphone/Release/tinyphone.exe,tinyphone-installer/bin/Release/tinyphone_installer.msi"
# draft: true
# allowUpdates: true
# token: ${{ secrets.GH_TOKEN }}