-
-
Notifications
You must be signed in to change notification settings - Fork 64
47 lines (46 loc) · 1.89 KB
/
create_release_dev.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
name: Create API Image (DEV)
on:
push:
branches:
- dev
paths:
- "server/api/**"
workflow_dispatch:
jobs:
build:
name: Create Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get branch name
uses: nelonoel/[email protected]
- name: Setup environment
run: |
echo GITHUB_CODE_VERSION=${{ env.BRANCH_NAME }} >> server/api/.env
echo GITHUB_SHA=${{ github.sha }} >> server/api/.env
echo GITHUB_TOKEN=${{ secrets.GH_ISSUES_TOKEN }} >> server/api/.env
echo GITHUB_PROJECT_URL=${{ secrets.GH_PROJECT_URL }} >> server/api/.env
echo GITHUB_ISSUES_URL=https://api.github.com/repos/hackforla/311-data-support/issues >> server/api/.env
echo SENDGRID_API_KEY=${{ secrets.SENDGRID_API_KEY }} >> server/api/.env
echo DEBUG=True >> server/api/.env
echo DB_ECHO=True >> server/api/.env
echo API_ALLOWED_ORIGINS=https://dev.311-data.org,http://localhost:3000,http://0.0.0.0:3000,https://311-data.matt-webster.net >> server/api/.env
- name: Build and Push Image to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
path: server/api
repository: la311data/311_data_api
tag_with_ref: true
tag_with_sha: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: (Rolling) Restart ECS Tasks
run: |
aws ecs update-service --cluster prod-la-311-data-cluster --service dev-la-311-data-svc --force-new-deployment