-
-
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
244 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Build and publish a base PHP image for LF | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
IMAGE: sillsdev/web-languageforge:base-php | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build and tag base image | ||
run: docker build -t ${{ env.IMAGE }} -f docker/base-php/Dockerfile . | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | ||
|
||
- name: Publish image | ||
run: | | ||
docker push ${{ env.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,59 @@ | ||
name: Deploy to staging | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
IMAGE: ${{ steps.image.outputs.NAMESPACE }}:${{ steps.image.outputs.TAG }} | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: Build app | ||
working-directory: ./docker/ | ||
run: docker-compose build --build-arg ENVIRONMENT=production app | ||
- | ||
name: Check unit tests | ||
working-directory: ./docker/ | ||
run: make unit-tests | ||
# - | ||
# name: Check e2e tests | ||
# working-directory: ./docker/ | ||
# run: make e2e-tests | ||
- | ||
name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | ||
- | ||
name: Establish image name | ||
id: image | ||
run: | | ||
echo ::set-output name=NAMESPACE::sillsdev/web-languageforge | ||
echo ::set-output name=TAG::develop-$(date +%Y%m%d)-${{ github.sha }} | ||
- | ||
name: Tag images | ||
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 }} | ||
|
||
deploy: | ||
runs-on: [self-hosted, languageforge] | ||
|
||
needs: build | ||
|
||
steps: | ||
- | ||
uses: sillsdev/common-github-actions/install-kubectl@v1 | ||
- | ||
run: kubectl --context ${{ secrets.LTOPS_K8S_STAGING_CONTEXT }} set image deployment/app app=${{ needs.build.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: Run unit tests | ||
|
||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | ||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: | ||
- staging | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run unit tests | ||
working-directory: ./docker/ | ||
run: make unit-tests | ||
|
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.