diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..80e2fb9 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,31 @@ +name: Build and Deploy +on: + push: + pull_request: + workflow_dispatch: +jobs: + buildAndDeploy: + name: Build and Deploy Docker Image + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/wisvch/BTWebsite2024 + tags: type=sha, prefix={{date 'YYYYMMDD'}}- + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + push: ${{ github.ref == 'refs/heads/main' }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f750ef4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +# FROM node:20-alpine AS builder + +# RUN apk add python2 +# RUN npm i +# RUN npx gulp build + +FROM ghcr.io/wisvch/nginx +COPY /public_html/ /srv/ \ No newline at end of file