-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (36 loc) · 1.24 KB
/
slackbot-docker-build-and-public.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
name: Build and Publish "slackbot" docker image
on:
push:
branches: ["master"]
workflow_dispatch:
branches: ["master"]
permissions:
contents: read
jobs:
files-changed:
name: slackbot
runs-on: ubuntu-20.04
timeout-minutes: 3
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
infra:
- 'slackbot/**'
# run only if some file in 'infra' folder was changed
- if: steps.changes.outputs.infra == 'true'
run: docker build -t "slackbot:bolt" slackbot
- if: steps.changes.outputs.infra == 'true'
env:
CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: |
#TODO: do not hard code project & location
echo $CREDENTIALS > /tmp/cred.json
cat /tmp/cred.json | docker login -u _json_key --password-stdin https://us-east4-docker.pkg.dev/development-380917/docker-repository
docker tag slackbot:bolt us-east4-docker.pkg.dev/development-380917/docker-repository/slackbot
docker push us-east4-docker.pkg.dev/development-380917/docker-repository/slackbot