Files
docker-radius/.github/workflows/build.yml
Luke Tainton (ltainton) 9b9c75ec18 on-demand build
2023-11-26 22:38:46 +00:00

27 lines
1.0 KiB
YAML

name: Build Docker Image
on:
workflow_dispatch:
push:
branches: [master]
jobs:
build:
name: GitHub Container Registry
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Login to GitHub Container Registry
run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin
- name: Build image for GitHub Package Registry
run: docker build . --file Dockerfile --tag ghcr.io/luketainton/docker-radius:${{ steps.vars.outputs.sha_short }} --tag ghcr.io/luketainton/docker-radius:latest
- name: Push image to GitHub Package Registry
run: |
docker push ghcr.io/luketainton/docker-radius:latest
docker push ghcr.io/luketainton/docker-radius:${{ steps.vars.outputs.sha_short }}