generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
312 changed files
with
9,644 additions
and
2,267 deletions.
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
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
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
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
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,58 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
env: | ||
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }} | ||
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }} | ||
GHCR_REPO: "ghcr.io/dfe-digital/buy-for-your-school" | ||
CF_USER: ${{ secrets.CF_USER }} | ||
CF_PASSWORD: ${{ secrets.CF_PASSWORD }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
GITHUB_SECRETS_JSON: ${{ toJson(secrets) }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tf_var_docker_image: ${{ steps.tf_var_docker_image.outputs.value }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Set Docker tag environment variable | ||
run: echo "DOCKER_TAG=${GITHUB_RUN_ID}-${GITHUB_SHA}" >> $GITHUB_ENV | ||
- name: Set Docker Image environment variable | ||
run: echo "DOCKER_IMAGE=$GHCR_REPO:$DOCKER_TAG" >> $GITHUB_ENV | ||
- name: Set TFVAR Docker Image environment variable | ||
run: echo "TF_VAR_docker_image=$DOCKER_IMAGE" >> $GITHUB_ENV | ||
- name: Set TFVAR Docker Image output | ||
id: tf_var_docker_image | ||
run: echo "::set-output name=value::$TF_VAR_docker_image" | ||
- name: Build | ||
run: script/docker-push-ghcr | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Set TFVAR Docker Image environment variable | ||
run: echo "TF_VAR_docker_image=${{needs.build.outputs.tf_var_docker_image}}" >> $GITHUB_ENV | ||
- name: Deploy terraform to staging | ||
env: | ||
TF_VAR_environment: "staging" | ||
run: | | ||
script/deploy-terraform | ||
if: github.ref == 'refs/heads/develop' | ||
- name: Deploy terraform to prod | ||
env: | ||
TF_VAR_environment: "prod" | ||
run: | | ||
script/deploy-terraform | ||
if: github.ref == 'refs/heads/main' |
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
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
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
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
Oops, something went wrong.