Created
September 18, 2023 07:52
-
-
Save ccfiel/095e8ca011ed86228226646d694959b5 to your computer and use it in GitHub Desktop.
staging.yml
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
name: KaHero GraphQL Server Staging | |
run-name: ${{ github.actor }} is building KaHero GraphQL Server Staging 🚀 | |
on: | |
push: | |
branches: | |
- 'release/**' | |
- 'hotfix/**' | |
jobs: | |
Build-Staging-GraphQL-Server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm ci | |
- name: Get Version | |
id: version | |
uses: paulhatch/[email protected] | |
with: | |
tag_prefix: "v" | |
major_pattern: "(MAJOR)" | |
minor_pattern: "(MINOR)" | |
version_format: "${major}.${minor}.${patch}" | |
namespace: ${{ github.ref_type}} | |
user_format_type: "csv" | |
- run: VERSION=${{ steps.version.outputs.version }} npm run version | |
- run: tail src/schemas/Version/queries.ts | |
- run: npm run build | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.REGISTRY }} | |
username: ccfiel | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tagging the source | |
run: | | |
NEW_TAG=v${{ steps.version.outputs.version }} | |
git tag $NEW_TAG | |
git push origin --tags | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: ${{ secrets.REGISTRY }}/${{ github.repository }} | |
tags: | | |
${{ steps.version.outputs.version }} | |
staging | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Deploy to Northflank (production) | |
run: | | |
curl -X GET https://api-internal.northflank.com/webhooks/release-flows/${{ secrets.NF_WEB_HOOK_STAGING }}?sha=${{ github.sha }} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment