forked from dso-toolkit/dso-toolkit
-
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.
dso-toolkit#2568 [Task] Build: GitHub Actions pipeline
- Loading branch information
1 parent
baebb6a
commit 744cb87
Showing
50 changed files
with
244 additions
and
488 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: CI | ||
on: [push] | ||
|
||
jobs: | ||
CI: | ||
name: lint, build, test, deploy | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
name: Log in to GitHub Container Registry | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
if (context.eventName === 'push') { | ||
const [branch, type] = context.ref.split('/').reverse(); | ||
if (type === 'heads' && branch.lastIndexOf('#') === 0) { | ||
core.exportVariable('DT_REF', branch.replace(/#/, '_')); | ||
} | ||
else if (type === 'heads' && branch === 'master') { | ||
core.exportVariable('DT_REF', 'master'); | ||
} | ||
else if (type === 'tags' && branch[0] === 'v') { | ||
core.exportVariable('DT_REF', branch.substring(1)); | ||
core.exportVariable('DT_DIST_TAG', 'latest'); | ||
} | ||
} | ||
- name: Output DT_REF | ||
run: echo $DT_REF; | ||
- uses: docker/build-push-action@v5 | ||
name: Build and push Docker image | ||
with: | ||
push: true | ||
tags: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} | ||
context: . | ||
cache-from: | | ||
ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} | ||
cache-to: type=inline | ||
build-args: | | ||
CI | ||
DT_REF | ||
- name: "Prepare Cypress Parallel weights file" | ||
run: mkdir --verbose --parents ${{ github.workspace }}/storybook/cypress-parallel | ||
- name: "Cache: Cypress Parallel weights file" | ||
id: cypress-parallel-weights-file-cache | ||
uses: actions/cache@v4 | ||
with: | ||
key: weights-file | ||
path: ${{ github.workspace }}/storybook/cypress-parallel/parallel-weights.json | ||
- name: e2e tests | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
image: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} | ||
options: --env CI | ||
--env DT_REF | ||
--volume ${{ github.workspace }}/storybook/cypress-parallel:/usr/src/app/storybook/cypress-parallel | ||
run: yarn e2e | ||
- uses: addnab/docker-run-action@v3 | ||
name: Deploy | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
image: ghcr.io/tfrijsewijk/dso-toolkit:${{ env.DT_REF }} | ||
options: --env CI | ||
--env DT_REF | ||
--env DT_DIST_TAG | ||
--env DT_PRIVATE_KEY_BASE64 | ||
--env DT_DEPLOY_HOST | ||
--env DT_DEPLOY_PORT | ||
--env DT_DEPLOY_USER | ||
--env DT_DEPLOY_ROOT | ||
--env DT_DEPLOY_NPM_TOKEN | ||
--env GITHUB_TOKEN | ||
run: bash deploy.sh | ||
env: | ||
DT_PRIVATE_KEY_BASE64: ${{ secrets.DT_PRIVATE_KEY_BASE64 }} | ||
DT_DEPLOY_HOST: ${{ secrets.DT_DEPLOY_HOST }} | ||
DT_DEPLOY_PORT: ${{ secrets.DT_DEPLOY_PORT }} | ||
DT_DEPLOY_USER: ${{ secrets.DT_DEPLOY_USER }} | ||
DT_DEPLOY_ROOT: ${{ secrets.DT_DEPLOY_ROOT }} | ||
DT_DEPLOY_NPM_TOKEN: ${{ secrets.DT_DEPLOY_NPM_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,16 @@ | ||
name: Danger | ||
on: [pull_request] | ||
jobs: | ||
Danger: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Danger | ||
run: | | ||
npm install --global typescript danger | ||
danger ci --failOnErrors | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} |
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
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
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ describe("ActionList", () => { | |
}); | ||
|
||
it("screenshot", () => { | ||
cy.percySnapshot(); | ||
// cy.percySnapshot(); | ||
}); | ||
}); |
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
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.