Skip to content

Commit

Permalink
Merge pull request #103 from BuckinghamAJ/feature/docker_api_5
Browse files Browse the repository at this point in the history
Adding Github Action workflow. Does not affect codebase so going to merge right away.
  • Loading branch information
BuckinghamAJ authored Jul 3, 2023
2 parents b9cabb2 + 49b67ad commit f77f371
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/deploy.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: SRT-API DEV Deploy

on:
push:
branches:
- 'dev'

jobs:
docker:
name: Build and Push Docker Image
runs-on: ubuntu-latest
outputs:
formattedTime: ${{ steps.current-time.outputs.formattedTime }}
steps:
-
name: Get Current Time
uses: josStorer/[email protected]
id: current-time
with:
format: YYYYMMDD-HHmmss
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.9.1
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/srt-api:dev-${{ steps.current-time.outputs.formattedTime }}

cloudgov:
name: Deploying to Cloud.gov
runs-on: ubuntu-latest
needs: docker
steps:
-
name: Checkout
uses: actions/[email protected]
-
name: Check Working Directory
run: |
ls -la
-
name: Push to Cloud.gov Dev Space
uses: citizen-of-planet-earth/cf-cli-action@master
with:
cf_api: https://api.fr.cloud.gov
cf_username: ${{ secrets.CF_USER }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: gsa-ogp-srt
cf_space: dev
command: push srt-api-dev -f cf/manifest.dev.yml --docker-image ${{ secrets.DOCKERHUB_USERNAME }}/srt-api:dev-${{ needs.docker.outputs.formattedTime }}
2 changes: 1 addition & 1 deletion cf/manifest.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
applications:
- name: srt-server-dev
- name: srt-api-dev
memory: 512M
disk_quota: 2048M
# health-check-type: process # don't re-enable....move to port 8080 if you have problems
Expand Down

0 comments on commit f77f371

Please sign in to comment.