-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from BuckinghamAJ/feature/docker_api_5
Adding Github Action workflow. Does not affect codebase so going to merge right away.
- Loading branch information
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters