26 lines
1008 B
YAML
26 lines
1008 B
YAML
name: Build Docker Image
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
name: GitHub Container Registry
|
|
runs-on: ubuntu-latest
|
|
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 }}
|