diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..47719be --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +fly.toml +Dockerfile +.dockerignore +node_modules +.git diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..759692e --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,49 @@ +name: Deployment pipeline + +on: + push: + branches: + - master + pull_request: + branches: [master] + types: [opened, synchronize] + +jobs: + deployment_prep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: '16' + - name: npm install + run: npm install + - name: lint + run: npm run lint + - name: build + run: npm run build + deploy: + name: Deploy app + needs: [deployment_prep] + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ''), '#skip') }} + steps: + - uses: actions/checkout@v3 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + tag_release: + needs: [deploy] + permissions: write-all + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ''), '#skip') }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - name: Bump version and push tag + uses: anothrNick/github-tag-action@eca2b69f9e2c24be7decccd0f15fdb1ea5906598 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BUMP: 'patch' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b920352 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:bullseye as builder + +ARG NODE_VERSION=16.16.0 + +RUN apt-get update; apt install -y curl python-is-python3 pkg-config build-essential +RUN curl https://get.volta.sh | bash +ENV VOLTA_HOME /root/.volta +ENV PATH /root/.volta/bin:$PATH +RUN volta install node@${NODE_VERSION} + +####################################################################### + +RUN mkdir /app +WORKDIR /app + +# NPM will not install any package listed in "devDependencies" when NODE_ENV is set to "production", +# to install all modules: "npm install --production=false". +# Ref: https://docs.npmjs.com/cli/v9/commands/npm-install#description + +ENV NODE_ENV production + +COPY . . + +RUN npm install && npm run build +FROM debian:bullseye + +LABEL fly_launch_runtime="nodejs" + +COPY --from=builder /root/.volta /root/.volta +COPY --from=builder /app /app + +WORKDIR /app +ENV NODE_ENV production +ENV PATH /root/.volta/bin:$PATH + +CMD [ "npm", "run", "start" ] diff --git a/client/components/App 2.js b/client/components/App 2.js new file mode 100644 index 0000000..3e51fa7 --- /dev/null +++ b/client/components/App 2.js @@ -0,0 +1,12 @@ +import React from 'react' +import NavBar from 'Components/NavBar' +import Footer from 'Components/Footer' +import Router from 'Components/Router' + +export default () => ( + <> + + +