-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.3 KB
/
deploy.yml
File metadata and controls
50 lines (41 loc) · 1.3 KB
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: Deploy
on:
push:
branches:
- master
- development
workflow_dispatch:
env:
DOCKER_IMAGE: ${{ github.repository }}
DOCKER_REGISTRY: ghcr.io
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USERNAME: ${{ github.repository_owner }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Branch Tag Action
uses: nimblehq/branch-tag-action@v1.2
- name: Set HEROKU_APP
run: |
if [[ $BRANCH_TAG = "latest" ]]
then
echo "HEROKU_APP=ruby-google-scraper" >> $GITHUB_ENV
else
echo "HEROKU_APP=ruby-google-scraper-staging" >> $GITHUB_ENV
fi
- name: Docker login to docker container registry
run: "echo $DOCKER_TOKEN | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin"
- name: Docker build
run: |
bin/docker-prepare
docker-compose build
docker-compose push web
- name: Heroku login
run: heroku container:login
- name: Heroku release
run: |
heroku container:push --arg DOCKER_REGISTRY=$DOCKER_REGISTRY,DOCKER_IMAGE=$DOCKER_IMAGE,BRANCH_TAG=$BRANCH_TAG --recursive
heroku container:release web worker