-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (115 loc) · 4.17 KB
/
release-slackbot-proxy.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Release Docker Image for @growi/slackbot-proxy
on:
pull_request:
branches:
- release/slackbot-proxy/**
types: [closed]
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Retrieve information from package.json
uses: myrotvorets/info-from-package-json-action@1.2.0
id: package-json
with:
workingDir: apps/slackbot-proxy
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: weseek/growi-slackbot-proxy,ghcr.io/weseek/growi-slackbot-proxy,asia.gcr.io/${{ secrets.GCP_PRJ_ID_SLACKBOT_PROXY }}/growi-slackbot-proxy
tags: |
type=raw,value=latest
type=raw,value=${{ steps.package-json.outputs.packageVersion }}
- name: Login to docker.io registry
run: |
echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: wsmoogle
password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
- name: Authenticate to Google Cloud for GROWI.cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_SA_KEY_SLACKBOT_PROXY }}'
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Configure docker for gcloud
run: |
gcloud auth configure-docker --quiet
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/slackbot-proxy/docker/Dockerfile
platforms: linux/amd64
push: true
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Add tag
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: v${{ steps.package-json.outputs.packageVersion }}
VERBOSE : true
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: wsmoogle
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
repository: weseek/growi-slackbot-proxy
readme-filepath: ./apps/slackbot-proxy/docker/README.md
create-pr-for-next-rc:
needs: build-and-push-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- name: Install dependencies
run: |
yarn global add turbo
yarn global add node-gyp
yarn --frozen-lockfile
- name: Bump versions for next RC
run: |
turbo run version --filter=@growi/slackbot-proxy -- --prerelease
- name: Retrieve information from package.json
uses: myrotvorets/info-from-package-json-action@1.2.0
id: package-json
with:
workingDir: apps/slackbot-proxy
- name: Commit
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
commit-message: 'Bump version'
name: GitHub Action
- name: Create PR
uses: repo-sync/pull-request@v2
with:
source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
destination_branch: master
pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
pr_label: flag/exclude-from-changelog,type/prepare-next-version
pr_body: "An automated PR generated by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
github_token: ${{ secrets.GITHUB_TOKEN }}