diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6180590..f534193c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,10 @@ -name: GitHub Pages +name: 👷‍♀️ Build website to deployment branch on: workflow_dispatch: + release: + types: [published] + jobs: deployment: runs-on: ubuntu-latest diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml new file mode 100644 index 00000000..2017ce65 --- /dev/null +++ b/.github/workflows/test-build.yml @@ -0,0 +1,34 @@ +name: 👷 Deploy test site to github pages + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + deployment: + runs-on: ubuntu-latest + environment: production + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Setup Node + uses: actions/setup-node@v3 + - name: Install + run: npm ci + - name: Build and Deploy + env: + NODE_ENV: production + # This is set automatically by github + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.name "Automated" + git config user.email "actions@users.noreply.github.com" + git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/open-pv/website.git + echo "User-agent: *" > public/robots.txt + echo "Disallow: /" >> public/robots.txt + npm run build + npm run deploy:test diff --git a/RELEASE-PROCEDURE.md b/RELEASE-PROCEDURE.md new file mode 100644 index 00000000..3b3d1f97 --- /dev/null +++ b/RELEASE-PROCEDURE.md @@ -0,0 +1,29 @@ +# Release Procedure + +## Version Numbers + +This software follows the [Semantic Versioning (SemVer)](https://semver.org/).
+It always has the format `MAJOR.MINOR.PATCH`, e.g. `1.5.0`. + +## GitHub Release + +### 1. 📝 Check correctness of test.openpv.de + +- Navigate to test.openpv.de +- Check that this is the website you want to deploy +- Check that it has no bugs + +### 2. 🐙 Create a `GitHub Release` + +- Named `v0.12.1` +- Possibly add a Title to the Release Notes Headline +- Summarize key changes in the description + - Use the `generate release notes` button provided by GitHub +- Make sure that new contributors are mentioned +- Choose the correct git `tag` +- Choose the `main` branch +- Publish release + +### 3. Deployment + +- Start the manual deployment process based on the `build` branch diff --git a/package.json b/package.json index 5661c337..97e4e9c0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "deploy": "gh-pages -d dist -b build" + "deploy": "gh-pages -d dist -b build", + "deploy:test": "gh-pages -d dist -b gh-pages" }, "dependencies": { "@chakra-ui/react": "^2.8.2",