From 9fd2c221287ac50598e29040177815816e02aea5 Mon Sep 17 00:00:00 2001 From: Berry den Hartog <38954346+berrydenhartog@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:56:32 +0000 Subject: [PATCH] Add github container build --- .github/dependabot.yml | 11 +++---- .github/workflows/build.yaml | 60 ++++++++++++++++++++++++++++++++++++ .gitignore | 35 +++++++++++++++++++-- 3 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f33a02cd..10d12ef0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,11 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for more information: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -# https://containers.dev/guide/dependabot - version: 2 updates: - package-ecosystem: "devcontainers" directory: "/" schedule: interval: weekly + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..d04ee09e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,60 @@ +name: build + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +env: + REGISTRY: ghcr.io + IMAGE_NAME: "minbzk/beslisboom" + +jobs: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + actions: read + steps: + - uses: actions/checkout@v4 + + # for testing we copy it. In production we should use a link to github + - name: copy files + run: | + cp decision-tree.yaml frontend/public/decision-tree.yaml + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ./frontend + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + annotations: ${{ steps.meta.outputs.annotations }} + platforms: linux/amd64,linux/arm64,darwin/amd64 diff --git a/.gitignore b/.gitignore index 7905a0ef..b2387c44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,32 @@ -determine-role-ex-transparantie-inc-subtree.json -subtree-ex-role.json -transparantie-tree.json +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo + +up.txt