Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Switch to AF github actions shared workflows #1515

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/_validate-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
workflow_call:

jobs:
build_test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm config set fund false
- run: npm ci
working-directory: 'backend'
- run: npm test
working-directory: 'backend'
- run: npm ci --legacy-peer-deps # TODO: remove --legacy-peer-deps after updating dependencies
- run: docker-compose up -d compiler
- run: perl -i -pe 's/https:\/\/compiler\.aepps\.com/http:\/\/localhost:3078/g' src/lib/networksRegistry.js
- run: npm test
- uses: stefanzweifel/git-auto-commit-action@v4
if: failure()
with:
commit_message: "fixme: update e2e screenshots"
file_pattern: 'tests/e2e/*.png'
- run: docker-compose logs
if: always()
24 changes: 24 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: integration

on:
push:
branches: [ develop ]

jobs:
validate:
uses: ./.github/workflows/_validate-npm.yml
publish:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [ validate ]
secrets: inherit
with:
DOCKERHUB_REPO: "aeternitybot/${{ github.event.repository.name }}"
deploy:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [publish]
secrets: inherit
with:
DEPLOY_ENV: stg
DEPLOY_APP: "${{ github.event.repository.name }}"
DEPLOY_VERSION: develop
DEPLOY_SUBDOMAIN: "base"
112 changes: 0 additions & 112 deletions .github/workflows/prod-docker.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/pull-request-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pull-request-cleanup

on:
pull_request:
branches: [ develop ]
types: [ closed ]

jobs:
rollback:
uses: aeternity/github-actions/.github/workflows/[email protected]
secrets: inherit
with:
DEPLOY_ENV: stg
DEPLOY_APP: ${{ github.event.repository.name }}
DEPLOY_VERSION: "pr-${{ github.event.number }}"
DEPLOY_SUBDOMAIN: "pr-${{ github.event.number }}-base"
delete-tag:
uses: aeternity/github-actions/.github/workflows/[email protected]
secrets: inherit
with:
DOCKERHUB_REPO: "aeternitybot/${{ github.event.repository.name }}"
DOCKERHUB_TAG: "pr-${{ github.event.number }}"
24 changes: 24 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: pull-request

on:
pull_request:
branches: [ develop ]

jobs:
validate:
uses: ./.github/workflows/_validate-npm.yml
publish:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [ validate ]
secrets: inherit
with:
DOCKERHUB_REPO: "aeternitybot/${{ github.event.repository.name }}"
deploy:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [publish]
secrets: inherit
with:
DEPLOY_ENV: stg
DEPLOY_APP: ${{ github.event.repository.name }}
DEPLOY_VERSION: "pr-${{ github.event.number }}"
DEPLOY_SUBDOMAIN: "pr-${{ github.event.number }}-base"
17 changes: 17 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: release-please

on:
push:
branches: [ master ]

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: ""
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"ci","section":"CI / CD","hidden":false},{"type":"test","section":"Testing","hidden":false},{"type":"refactor","section":"Refactorings","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: release

on:
push:
tags: [ v* ]

jobs:
publish:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [ validate ]
secrets: inherit
deploy:
uses: aeternity/github-actions/.github/workflows/[email protected]
needs: [publish]
secrets: inherit
with:
DEPLOY_ENV: prd
DEPLOY_APP: ${{ github.event.repository.name }}
DEPLOY_TAG: ${{ github.ref_name }}
131 changes: 0 additions & 131 deletions .github/workflows/staging-docker.yml

This file was deleted.

Loading
Loading