-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (61 loc) · 1.9 KB
/
Copy pathbuild.yml
File metadata and controls
70 lines (61 loc) · 1.9 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Docker Image CI
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Build DEV
if: github.ref == 'refs/heads/dev'
run: |
docker build -t ghcr.io/databio/lolaweb:dev .
- name: Build MASTER
if: github.ref == 'refs/heads/master'
run: |
docker build -t ghcr.io/databio/lolaweb:latest .
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PAT }}
- name: Push :latest to GHCR
id: push_latest_ghcr
if: github.ref == 'refs/heads/master'
run: docker push ghcr.io/databio/lolaweb:latest
- name: Push :dev to GHCR
id: push_dev_ghcr
if: github.ref == 'refs/heads/dev'
run: docker push ghcr.io/databio/lolaweb:dev
- name: Image digest
run: echo ${{ steps.push_ghcr.outputs.digest }}
deploy:
runs-on: ubuntu-latest
needs: build
steps:
-
name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.LOLA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.LOLA_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
-
name: Send SQS message
if: github.ref == 'refs/heads/master'
uses: isbang/sqs-action@v0.1.1
with:
sqs-url: https://queue.amazonaws.com/474683445819/lola-updates
message: 'master'
-
name: Send SQS message
if: github.ref == 'refs/heads/dev'
uses: isbang/sqs-action@v0.1.1
with:
sqs-url: https://queue.amazonaws.com/474683445819/lola-updates
message: 'dev'