Skip to content

Commit

Permalink
update registries and improve GHA
Browse files Browse the repository at this point in the history
Builds all PRs and pushes to main, making PRs :devel and pushes to main :latest. The built PR image tags will be commented on the PR
  • Loading branch information
PipeItToDevNull committed Dec 8, 2024
1 parent 5a05481 commit c0388ab
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/bsod-api-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPO: pipeittodevnull
IMAGE: bsod-api
REPO: r-techsupport
IMAGE: webdbg-api

jobs:
build_and_push:
Expand All @@ -18,7 +21,7 @@ jobs:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true

Expand All @@ -31,5 +34,10 @@ jobs:

- name: Build and push
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE}}:latest api/
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE}}:latest
TAG=$([[ ${{ github.ref }} == refs/heads/main ]] && echo "latest" || echo "devel")
docker build -t ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$TAG -t ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ github.sha.slice(0, 7) }} api/
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$TAG
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ github.sha.slice(0, 7) }}
- name: Log out from the Container registry
run: docker logout ${{ env.REGISTRY }}

0 comments on commit c0388ab

Please sign in to comment.