-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.51 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
name: "Bump version and publish docker image"
permissions: write-all
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Version Bump
run: |
npm i -g npm
npm i -g yarn
npm install -g commitlint semantic-release semantic-release-github-actions-tags @semantic-release/changelog @semantic-release/git
npx semantic-release --ci
env:
GH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
- name: Build Docker Image
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
run: |
docker-compose -f docker-compose.yml build
- name: Authenticate to GitHub Container Registry
run: echo ${{ secrets.GH_AUTH_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Push Docker Image to GitHub Packages
run: |
NEW_VERSION=$(node -p "require('./package.json').version")
docker tag osc_controller ghcr.io/${{ github.repository_owner }}/osc_controller:${NEW_VERSION}
docker push ghcr.io/${{ github.repository_owner }}/osc_controller:${NEW_VERSION}
env:
GHCR_PAT: ${{ secrets.GH_AUTH_TOKEN }}