diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8dfa02a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Docker Build and Push + +on: + push: + branches: + - main + +permissions: + id-token: write + contents: read + actions: read + +jobs: + build-and-push: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Set up buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push images + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + target: ghcr.io/hpcslab/cfp-summary-server:${{ github.sha }} + push: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eeb2d02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:22 + +WORKDIR /work +COPY api . +COPY db . +COPY views . +COPY index.js . +COPY package.json . + +RUN npm install --frozen-lockfile + +ENTRYPOINT [ "/usr/local/bin/node" ] +CMD [ "./index.js" ]