Skip to content

Toevoeging async request-response patroon #1549

Toevoeging async request-response patroon

Toevoeging async request-response patroon #1549

Workflow file for this run

name: Build
on:
pull_request:
push:
workflow_dispatch:
inputs:
branch:
description: "Branch name."
required: true
default: "main"
env:
IMAGE_NAME: ghcr.io/developer-overheid-nl/don-site
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
target: caddy
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.sha }}
outputs: type=docker,dest=${{ runner.temp }}/image.tar
secrets: |
"PIWIK_PRO_ACCOUNT_ADDRESS=${{ secrets.PIWIK_PRO_ACCOUNT_ADDRESS }}"
"PIWIK_PRO_SITE_ID=${{ secrets.PIWIK_PRO_SITE_ID }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: image
path: ${{ runner.temp }}/image.tar
retention-days: 1
publish:
if: |
github.repository == 'developer-overheid-nl/don-site' &&
(github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: image
path: ${{ runner.temp }}
- name: Load image
run: |
docker load --input ${{ runner.temp }}/image.tar
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
docker push --all-tags ${{ env.IMAGE_NAME }}