Some checks failed
Validate PR Title / validate (pull_request) Successful in 37s
CI / ci (pull_request) Successful in 1m35s
Release / Test (push) Failing after 1s
Release / Create Release (push) Has been skipped
Release / Print Release (push) Has been skipped
Release / Publish Docker Images (push) Has been skipped
28 lines
1.0 KiB
YAML
28 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
|
|
permissions:
|
|
packages: write
|
|
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.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
|
- name: Build image for GitHub Package Registry
|
|
run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.sha_short }} --tag ghcr.io/${{ github.repository }}:latest
|
|
- name: Push image to GitHub Package Registry
|
|
run: |
|
|
docker push ghcr.io/${{ github.repository }}:latest
|
|
docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.sha_short }}
|