You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This github actions installs and sets up the [Goose](https://github.com/pressly/goose) migration tool binary.
4
+
5
+
## Example usage
6
+
7
+
```yaml
8
+
name: Migrate
9
+
10
+
on:
11
+
push:
12
+
branches: ['main']
13
+
14
+
jobs:
15
+
migrate:
16
+
name: Migrate
17
+
runs-on: ubuntu-latest
18
+
steps:
19
+
- uses: actions/setup-go@v5
20
+
with:
21
+
go-version: '1.20.x'
22
+
23
+
- uses: actions/checkout@v3
24
+
25
+
- uses: mscno/setup-goose@v1
26
+
27
+
- run: goose up
28
+
```
29
+
30
+
That's it! This workflow will run your migrations using goose.
31
+
32
+
The action works on Linux and macOS runners. If you'd like support for Windows runners, let us know!
33
+
34
+
## Select goose version to install
35
+
By default, pressly/setup-goose installs the latest released version of goose.
36
+
37
+
You can select a version with the version parameter:
38
+
39
+
```yaml
40
+
- uses: mscno/setup-goose@v1
41
+
with:
42
+
version: v0.14.1
43
+
```
44
+
45
+
To build and install goose from source using go install, specify version: `tip`.
46
+
47
+
## Running Migrations
48
+
49
+
goose is a database migration tool. You manage your database schema by creating incremental SQL or Go scripts.
50
+
51
+
After installing goose with this action, you can run your migrations with goose up:
52
+
53
+
```yaml
54
+
- uses: mscno/setup-goose@v1
55
+
- run: goose up
56
+
```
57
+
58
+
59
+
You can also run specific migrations with goose up-to <version>, roll back migrations with goose down, and more. See the goose documentation for more information.
60
+
61
+
## A note on versioning
62
+
The @v0.X in the uses statement refers to the version of the action definition in this repo.
63
+
64
+
Regardless of what version of the action definition you use, pressly/setup-goose will install the latest released version of goose unless otherwise specified with version:.
0 commit comments