forked from ultrasoundmoney/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build, push, and if tags are present deploy.
- Loading branch information
Showing
4 changed files
with
146 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
tags: | ||
- "stag-*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DigitalOcean Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: registry.digitalocean.com/ultrasoundmoney | ||
username: ${{ secrets.DO_REGISTRY_USERNAME }} | ||
password: ${{ secrets.DO_REGISTRY_TOKEN }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: registry.digitalocean.com/ultrasoundmoney/serve-web | ||
tags: | | ||
type=raw,latest | ||
type=sha,prefix= | ||
- name: Wait for tests to succeed | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.ref }} | ||
check-name: test | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=registry,ref=registry.digitalocean.com/ultrasoundmoney/serve-web:latest | ||
cache-to: type=inline |
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,38 @@ | ||
name: deploy-prod | ||
|
||
on: | ||
push: | ||
tags: | ||
- "prod-*" | ||
|
||
jobs: | ||
wait-on-build: | ||
name: wait on build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait for build to succeed | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.ref }} | ||
check-name: build | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 | ||
deploy-serve-web: | ||
name: deploy serve-web | ||
runs-on: ubuntu-latest | ||
needs: deploy-k8s-resources | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Make short SHA available | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: deploy | ||
uses: steebchen/[email protected] | ||
with: | ||
config: ${{ secrets.KUBE_CONFIG_DATA_PROD }} | ||
command: set image deployment/serve-web serve-web=registry.digitalocean.com/ultrasoundmoney/gas-analysis:${{ steps.vars.outputs.sha_short }} | ||
- name: Verify deployment | ||
uses: steebchen/[email protected] | ||
with: | ||
config: ${{ secrets.KUBE_CONFIG_DATA_PROD }} | ||
command: rollout status deployment/serve-web |
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,38 @@ | ||
name: deploy-staging | ||
|
||
on: | ||
push: | ||
tags: | ||
- "stag-*" | ||
|
||
jobs: | ||
wait-on-build: | ||
name: wait on build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait for build to succeed | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.ref }} | ||
check-name: build | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 | ||
deploy-serve-web: | ||
name: deploy serve-web | ||
runs-on: ubuntu-latest | ||
needs: deploy-k8s-resources | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Make short SHA available | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: deploy | ||
uses: steebchen/[email protected] | ||
with: | ||
config: ${{ secrets.KUBE_CONFIG_DATA_STAG }} | ||
command: set image deployment/serve-web serve-web=registry.digitalocean.com/ultrasoundmoney/serve-web:${{ steps.vars.outputs.sha_short }} | ||
- name: Verify deployment | ||
uses: steebchen/[email protected] | ||
with: | ||
config: ${{ secrets.KUBE_CONFIG_DATA_STAG }} | ||
command: rollout status deployment/serve-web |
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,27 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: | ||
- "stag-*" | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
- name: install deps | ||
run: yarn install | ||
- name: check types | ||
run: yarn check-types | ||
- name: lint | ||
run: yarn lint | ||
- name: test | ||
run: yarn build |