GetMoarFediverse/.github/workflows/build.yml

31 lines
971 B
YAML

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
- 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
shell: pwsh
run: |
Push-Location src
$version = (nbgv get-version -f json | ConvertFrom-Json).SimpleVersion
Write-Host "Version $version"
Pop-Location
docker build . --tag ghcr.io/g3rv4/importdataasrelay:latest --tag "ghcr.io/g3rv4/importdataasrelay:$version"
docker push ghcr.io/g3rv4/importdataasrelay:latest
docker push "ghcr.io/g3rv4/importdataasrelay:$version"