Add initial github actions setup for develop branch
This commit is contained in:
47
.github/workflows/dev.yml
vendored
Normal file
47
.github/workflows/dev.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: Dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ develop ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Publish to Registry
|
||||||
|
uses: elgohr/Publish-Docker-Github-Action@master
|
||||||
|
with:
|
||||||
|
name: standardnotes/web
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
tags: "latest,${{ github.sha }}"
|
||||||
|
|
||||||
|
- 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: us-east-1
|
||||||
|
|
||||||
|
- name: Download task definition
|
||||||
|
run: |
|
||||||
|
aws ecs describe-task-definition --task-definition app-dev --query taskDefinition > task-definition.json
|
||||||
|
|
||||||
|
- name: Fill in the new image ID in the Amazon ECS task definition
|
||||||
|
id: task-def
|
||||||
|
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: task-definition.json
|
||||||
|
container-name: app-dev
|
||||||
|
image: "standardnotes/app:${{ github.sha }}"
|
||||||
|
|
||||||
|
- name: Deploy Amazon ECS task definition
|
||||||
|
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||||
|
with:
|
||||||
|
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
||||||
|
service: app-dev
|
||||||
|
cluster: dev
|
||||||
|
wait-for-service-stability: true
|
||||||
Reference in New Issue
Block a user