FakeRelay/.github/workflows/build.yml

31 lines
939 B
YAML
Raw Normal View History

2022-12-03 21:27:52 +01:00
name: build
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # get entire git tree, required for nerdbank gitversioning
2022-12-03 21:39:05 +01:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the Docker image
2022-12-03 21:27:52 +01:00
shell: pwsh
run: |
2022-12-03 21:39:05 +01:00
Push-Location src
2022-12-03 21:27:52 +01:00
$version = (nbgv get-version -f json | ConvertFrom-Json).SimpleVersion
Write-Host "Version $version"
2022-12-03 21:39:05 +01:00
Pop-Location
docker build . --tag ghcr.io/g3rv4/fakerelay:latest --tag "ghcr.io/g3rv4/fakerelay:$version"
docker push ghcr.io/g3rv4/fakerelay:latest
docker push "ghcr.io/g3rv4/fakerelay:$version"