forked from kamba4/sunders
chore: Reverts workflow changes
Some checks failed
Build (and tag) Images / build (push) Has been cancelled
Some checks failed
Build (and tag) Images / build (push) Has been cancelled
The image build workflow is handled separately in the kaniko-build branch; this pull request no longer changes it.
This commit is contained in:
parent
da84719d3c
commit
d724be54bf
1 changed files with 33 additions and 29 deletions
|
|
@ -6,48 +6,52 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: docker
|
runs-on: windows-2022
|
||||||
container:
|
|
||||||
image: ghcr.io/osscontainertools/kaniko:alpine
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install required system packages
|
|
||||||
run: apk add --no-cache nodejs git
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Login to Container Registry
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: git.hamburg.ccc.de
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Set image tags
|
- name: Set image tags
|
||||||
id: vars
|
id: vars
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ forgejo.ref_name }}" = "main" ] && [ "${{ forgejo.event_name }}" = "push" ]; then
|
if [ "${{ github.ref_name }}" = "main" ] && [ "${{ github.event_name }}" = "push" ]; then
|
||||||
echo "tag=latest" >> $GITHUB_OUTPUT
|
echo "tag=latest" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
# renovate creates sub branches with `/`; these break the tagging in the build process
|
# renovate creates sub branches with `/`; these break the tagging in the build process
|
||||||
echo tag=$(echo "${{ forgejo.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/_/g') >> $GITHUB_OUTPUT
|
echo tag=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/_/g') >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build web image
|
- name: Build web image
|
||||||
env:
|
|
||||||
KANIKO_NO_PUSH: ${{ forgejo.event_name != 'push' }}
|
|
||||||
KANIKO_GIT_HAMBURG_CCC_DE_USER: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
KANIKO_GIT_HAMBURG_CCC_DE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
/kaniko/executor \
|
docker buildx build -f ./Containerfile -t git.hamburg.ccc.de/ccchh/sunders/web:${{ steps.vars.outputs.tag }} --load .
|
||||||
--dockerfile="${{ forgejo.workspace }}/web/Containerfile" \
|
working-directory: ./web
|
||||||
--context="dir://${{ forgejo.workspace }}/web" \
|
|
||||||
--destination=git.hamburg.ccc.de/ccchh/sunders/web:${{ steps.vars.outputs.tag }} \
|
|
||||||
--no-push-cache \
|
|
||||||
--credential-helpers=env
|
|
||||||
|
|
||||||
- name: Build data_handler image
|
- name: Build data_handler image
|
||||||
env:
|
|
||||||
KANIKO_NO_PUSH: ${{ forgejo.event_name != 'push' }}
|
|
||||||
KANIKO_GIT_HAMBURG_CCC_DE_USER: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
KANIKO_GIT_HAMBURG_CCC_DE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
/kaniko/executor \
|
docker buildx build -f ./Containerfile -t git.hamburg.ccc.de/ccchh/sunders/data_handler:${{ steps.vars.outputs.tag }} --load .
|
||||||
--dockerfile="${{ forgejo.workspace }}/data_handler/Containerfile" \
|
working-directory: ./data_handler
|
||||||
--context="dir://${{ forgejo.workspace }}/data_handler" \
|
|
||||||
--destination=git.hamburg.ccc.de/ccchh/sunders/data_handler:${{ steps.vars.outputs.tag }} \
|
- name: Push images to Container Registry
|
||||||
--no-push-cache \
|
run: |
|
||||||
--credential-helpers=env
|
docker push git.hamburg.ccc.de/ccchh/sunders/web:${{ steps.vars.outputs.tag }}
|
||||||
|
docker push git.hamburg.ccc.de/ccchh/sunders/data_handler:${{ steps.vars.outputs.tag }}
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
|
||||||
|
- name: Update docker-compose.yml image tags
|
||||||
|
run: |
|
||||||
|
sed -i "s/:latest/:${{ steps.vars.outputs.tag }}/g" docker-compose.yml
|
||||||
|
|
||||||
|
- name: Start Docker Compose services
|
||||||
|
run: |
|
||||||
|
docker compose up -d --wait
|
||||||
|
docker compose down
|
||||||
Loading…
Reference in a new issue