tonyslist/.gitea/workflows/image-build.yaml
Tony Grosinger de083c16e1
All checks were successful
Build Production Image / Build Production Image (push) Successful in 5m41s
Unit test before pushing image
And disable unit test on git push
2024-01-11 18:37:35 -08:00

52 lines
1.4 KiB
YAML

name: Build Production Image
run-name: $GITHUB_REF_TYPE Production Build
on:
push:
tags:
- "*.*.*"
jobs:
Build Production Image:
runs-on: ubuntu-latest
container:
image: git.grosinger.net/tgrosinger/runner-image:0.0.3
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Docker registry
uses: docker/login-action@v2
with:
registry: git.grosinger.net
username: tgrosinger
password: ${{ secrets.CONTAINER_REGISTRY_ACCESS_TOKEN }}
- name: Build container for testing
uses: docker/build-push-action@v4
with:
context: .
target: builder
push: false
load: true
tags: tonyslist:${{ gitea.ref_name }}
- name: Run tests
run: |
docker run --rm --workdir /build --entrypoint make tonyslist:${{ gitea.ref_name }} test
- name: Remove temporary container
if: always()
run: |
docker rmi tonyslist:${{ gitea.ref_name }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
target: prod
push: true
tags: git.grosinger.net/tgrosinger/tonyslist:${{ gitea.ref_name }}