-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
17 changed files
with
662 additions
and
692 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,81 @@ | ||
name: Integrate changes and deploy | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
workflow_call: | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs | ||
inputs: | ||
image-tag: | ||
type: string | ||
required: true | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callsecrets | ||
secrets: | ||
kube-context: | ||
required: true | ||
image-repo-username: | ||
required: true | ||
image-repo-password: | ||
required: true | ||
|
||
jobs: | ||
integrate: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# https://docs.docker.com/develop/develop-images/build_enhancements/ | ||
DOCKER_BUILDKIT: 1 | ||
|
||
defaults: | ||
run: | ||
working-directory: docker | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
run: | | ||
docker --version | ||
docker-compose --version | ||
- | ||
name: Establish image name | ||
id: image | ||
run: | | ||
echo ::set-output name=NAMESPACE::sillsdev/web-languageforge | ||
echo ::set-output name=TAG::${{ inputs.image-tag }} | ||
- | ||
name: Build app | ||
run: docker-compose build --build-arg ENVIRONMENT=production --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG }} app | ||
- | ||
run: docker-compose run --rm app cat /var/www/html/build-version.txt /var/www/html/version.php | ||
- | ||
name: Check unit tests | ||
run: make unit-tests-ci | ||
- | ||
name: Check e2e tests | ||
run: make e2e-tests-ci | ||
- | ||
name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.image-repo-username }} | ||
password: ${{ secrets.image-repo-password }} | ||
- | ||
name: Tag image | ||
run: docker tag lf-app ${{ steps.image.outputs.NAMESPACE }}:${{ steps.image.outputs.TAG }} | ||
- | ||
name: Publish image | ||
run: docker push ${{ steps.image.outputs.NAMESPACE }}:${{ steps.image.outputs.TAG }} | ||
|
||
outputs: | ||
IMAGE: ${{ steps.image.outputs.NAMESPACE }}:${{ steps.image.outputs.TAG }} | ||
|
||
deploy: | ||
runs-on: [self-hosted, languageforge] | ||
|
||
needs: integrate | ||
|
||
steps: | ||
- | ||
uses: sillsdev/common-github-actions/install-kubectl@v1 | ||
- | ||
run: kubectl --context ${{ secrets.kube-context }} set image deployment/app app=${{ needs.integrate.outputs.IMAGE }} |
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,21 @@ | ||
name: Deploy to production | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
staging: | ||
if: github.event.base_ref == 'refs/heads/master' | ||
|
||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses | ||
uses: sillsdev/web-languageforge/.github/workflows/integrate-and-deploy.yml@master | ||
with: | ||
image-tag: $(echo ${{ github.ref }} | sed 's/refs\/tags\///') | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsecrets | ||
secrets: | ||
kube-context: ${{ secrets.LTOPS_K8S_PRODUCTION_CONTEXT }} | ||
image-repo-username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
image-repo-password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
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,19 @@ | ||
name: Deploy to staging | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
staging: | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses | ||
uses: sillsdev/web-languageforge/.github/workflows/integrate-and-deploy.yml@develop | ||
with: | ||
image-tag: develop-$(date +%Y%m%d)-${{ github.sha }} | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsecrets | ||
secrets: | ||
kube-context: ${{ secrets.LTOPS_K8S_STAGING_CONTEXT }} | ||
image-repo-username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
image-repo-password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
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,53 @@ | ||
name: Tests | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: docker | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: Run Unit Tests | ||
run: make unit-tests-ci | ||
- | ||
name: Publish Test Results | ||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1 | ||
if: always() | ||
with: | ||
check_name: Unit Test Results | ||
github_token: ${{ github.token }} | ||
files: docker/PhpUnitTests.xml | ||
|
||
e2e-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: Build app | ||
run: make build | ||
- | ||
name: Run E2E Tests | ||
run: make e2e-tests-ci | ||
- | ||
name: Publish Test Results | ||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1 | ||
if: always() | ||
with: | ||
check_name: E2E Test Results | ||
github_token: ${{ github.token }} | ||
files: docker/e2e-results.xml |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
PhpUnitTests.xml | ||
docker/e2e-results.xml | ||
src/assets/* | ||
!src/assets/.gitkeep | ||
src/cache/* | ||
|
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.