From 1cfc0a44e69f16a3c61b84ebacda378b2742847b Mon Sep 17 00:00:00 2001 From: ndsboy Date: Sun, 23 Feb 2025 00:12:01 +0000 Subject: [PATCH] feat: try buildah --- .forgejo/workflows/main.yml | 52 +++++++++++++++++++------------------ Containerfile | 7 ++++- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/.forgejo/workflows/main.yml b/.forgejo/workflows/main.yml index d2b15c8..5e7891e 100644 --- a/.forgejo/workflows/main.yml +++ b/.forgejo/workflows/main.yml @@ -22,32 +22,34 @@ jobs: name: 🚢 Deploy runs-on: docker container: - image: node:lts + image: quay.io/buildah/stable:latest if: github.ref == 'refs/heads/main' needs: [check] steps: - - uses: https://github.com/actions/checkout@v4 + - run: buildah build -f Containerfile . - - uses: https://github.com/denoland/setup-deno@v2 - with: - deno-version: v2.x - - run: deno task install - - run: deno task build - - - name: build containerfile - id: build-image - uses: https://github.com/redhat-actions/buildah-build@v2 - with: - image: website - tags: latest - containerfiles: | - ./Containerfile - - - name: Push to registry - uses: https://github.com/redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - username: token - password: ${{ secrets.GITHUB_TOKEN }} - registry: ${{ github.server_url }}/${{ github.repository }} + # - uses: https://github.com/actions/checkout@v4 + # + # - uses: https://github.com/denoland/setup-deno@v2 + # with: + # deno-version: v2.x + # - run: deno task install + # - run: deno task build + # + # - name: build containerfile + # id: build-image + # uses: https://github.com/redhat-actions/buildah-build@v2 + # with: + # image: website + # tags: latest + # containerfiles: | + # ./Containerfile + # + # - name: Push to registry + # uses: https://github.com/redhat-actions/push-to-registry@v2 + # with: + # image: ${{ steps.build-image.outputs.image }} + # tags: ${{ steps.build-image.outputs.tags }} + # username: token + # password: ${{ secrets.GITHUB_TOKEN }} + # registry: ${{ github.server_url }}/${{ github.repository }} diff --git a/Containerfile b/Containerfile index 8cc8f06..90a4cbe 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,11 @@ +FROM docker.io/denoland/deno AS build +COPY . . +RUN deno task install +RUN deno task build + FROM ghcr.io/swablab/documents:latest AS documents FROM docker.io/nginxinc/nginx-unprivileged:latest COPY ./nginx.conf /etc/nginx/conf.d/default.conf -COPY ./dist /usr/share/nginx/html +COPY --from=build ./dist /usr/share/nginx/html COPY --from=documents / /usr/share/nginx/html/docs \ No newline at end of file