-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (76 loc) · 2.67 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
name: Release
on:
pull_request:
types: [closed]
branches:
- master
jobs:
release:
if: github.event.pull_request.merged == true
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- uses: actions/setup-node@v1
with:
node-version: 10.20.1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
npm install yarn
yarn install
- name: Commit files
env:
HUSKY_SKIP_HOOKS: 1
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
VERSION=$(npm run next-version | tail -1)
DESCRIPTION=$(yarn run standard-version --dry-run --silent | grep -v yarn | grep -v Done | grep -v "\-\-\-" | grep -v standard-version)
DESCRIPTION="${DESCRIPTION//'%'/'%25'}"
DESCRIPTION="${DESCRIPTION//$'\n'/'%0A'}"
DESCRIPTION="${DESCRIPTION//$'\r'/'%0D'}"
echo "::set-env name=DESCRIPTION::$DESCRIPTION"
echo "::set-env name=VERSION::$VERSION"
yarn release
git push --follow-tags origin master
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
body: ${{ env.DESCRIPTION }}
draft: false
prerelease: false
- name: Build and push Docker base images
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mcauto/todo-list-fastapi-base
dockerfile: base.Dockerfile
tags: v${{ env.VERSION }}, latest
- name: Build and push Docker app images
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mcauto/todo-list-fastapi
dockerfile: app.Dockerfile
build_args: BASE_IMAGE=mcauto/todo-list-fastapi-base:latest
tags: v${{ env.VERSION }}, latest