From 486f8d7e5ed28cba2e2e0e5efcc03e1b62dcaeea Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 13 Feb 2023 21:52:35 +0000 Subject: [PATCH] Add Container and GHA to build --- .dockerignore | 11 +++++++ .editorconfig | 11 +++++++ .github/dependabot.yml | 10 +++++++ .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++ README.md | 20 +++++++++---- docker-compose.yml | 9 ++++++ 7 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..bb32a61 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +# Ignore git metadata folder +.git/ +.github/ + +# Ignore docker related files +Dockerfile* +docker-compose.* +.dockerignore +.gitignore + +.editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c0d0101 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# EditorConfig is awesome: https://EditorConfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..376872d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dc9bd01 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: ci + +on: + push: + branches: + - '**' + - '!dependabot/**' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' + - 'main' + - 'gh-pages' + schedule: + - cron: '25 3 */7 * *' + +concurrency: + group: ${{ github.workflow }}-{{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..74b7dc5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# https://github.com/nginxinc/docker-nginx-unprivileged +FROM nginxinc/nginx-unprivileged:stable-alpine as webserver + +RUN echo "absolute_redirect off;" >/etc/nginx/conf.d/no-absolute_redirect.conf + +COPY . /usr/share/nginx/html + +# Test configuration during docker build +RUN nginx -t + +# Port the container will listen on +EXPOSE 8080 diff --git a/README.md b/README.md index 356ae84..69f255d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# State of the Map +# State of the Map website -This repository contains various resources used for State of the Map -web sites. There are a number of branches: +This repository contains various resources used for State of the Map web sites. There are a number of branches: -* **chooser** source for [stateofthemap.org](https://stateofthemap.org/) -* **site-2013** source for [2013.stateofthemap.org](https://2013.stateofthemap.org/) +* **main** source for [stateofthemap.org](https://stateofthemap.org/) "chooser" * **resources-2012** additional resources for [2012.stateofthemap.org](https://2012.stateofthemap.org/) * **resources-2011** additional resources for [2011.stateofthemap.org](https://2011.stateofthemap.org/) * **resources-2010** additional resources for [2010.stateofthemap.org](https://2010.stateofthemap.org/) @@ -21,3 +19,15 @@ To clone this repository, use git clone --single-branch --branch https://github.com/openstreetmap/stateofthemap.git ``` Replace `` with the name of the branch you want to clone. + +## Other State of the Map website repositories + +* https://github.com/openstreetmap/stateofthemap-2022 +* https://github.com/openstreetmap/stateofthemap-2021 +* https://github.com/openstreetmap/stateofthemap-2020 +* https://github.com/openstreetmap/stateofthemap-2019 +* https://github.com/openstreetmap/stateofthemap-2018 +* https://github.com/openstreetmap/stateofthemap-2017 +* https://github.com/openstreetmap/stateofthemap-2016 +* https://github.com/openstreetmap/stateofthemap-2014 +* https://github.com/openstreetmap/stateofthemap-2013 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..233316c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '2' + +services: + + app: + build: + context: . + ports: + - 8080:8080 -- 2.39.5