Skip to content

Commit

Permalink
UHF-10248: Make sure secrets exist, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Oct 10, 2024
1 parent b5b14f3 commit 634877d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/update-config.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check if required secrets are set
env:
AUTOMATIC_UPDATE_TOKEN: ${{ secrets.AUTOMATIC_UPDATE_TOKEN }}
if: env.AUTOMATIC_UPDATE_TOKEN == ''
run: exit 1

- name: Download latest dump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 8 additions & 2 deletions documentation/automatic-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ The database dump is also used by all our automated tests.

## Adding update bot to your project

### Artifact action
### 1. Add required secrets

You must define a repository secret called `AUTOMATIC_UPDATE_TOKEN`.

Go to your repository's Settings -> Secrets and variables -> Actions and add a secret called `AUTOMATIC_UPDATE_TOKEN`. The value can be found from [Confluence](https://helsinkisolutionoffice.atlassian.net/wiki/spaces/HEL/pages/8354005224/Tunnusten+salasanojen+ja+muiden+avainten+jakaminen) under `AUTOMATIC_UPDATE_TOKEN` section.

### 2. Enable Artifact action

Enable the `artifact` action by adding [.github/workflows/artifact.yml](/.github/workflows/artifact.yml.dist) file to your repository. *NOTE*: `.github/workflows/artifact.yml.dist` might already exist, if it does then you can just rename it to `artifact.yml`.

Expand All @@ -57,7 +63,7 @@ This will generate an SQL-dump based on your site's current configuration and sa

The action will be run automatically once a week after you first run it.

### Update config action
### 3. Enable Update config action

Enable the `update-config` action by adding [.github/workflows/update-config.yml](/.github/workflows/update-config.yml.dist) file to your repository. *NOTE*: `.github/workflows/update-config.yml.dist` might already exist, if it does then you can just rename it to `update-config.yml`.

Expand Down

0 comments on commit 634877d

Please sign in to comment.