diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf92429..6200572 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,14 +6,16 @@ on: - master workflow_dispatch: # add manual button +permissions: + contents: write + packages: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + jobs: build: runs-on: ubuntu-latest - permissions: - contents: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - steps: - uses: actions/checkout@v4 @@ -24,9 +26,43 @@ jobs: - run: npm install - run: npm run build - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 + # upload to artifact + - uses: actions/upload-artifact@v4 + with: + name: "web" + path: | + dist/* + + # build Docker Image + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + latest + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: release - publish_dir: dist + context: . + file: Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fd1aec7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch + +COPY ./dist/ /app/