Github CI - Disable ipv6 (#88) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |