chore: update deploy #573
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: Publish | |
on: | |
push: | |
branches: [ next ] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- uses: ./.github/actions/codecheck | |
push: | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
permissions: | |
contents: read | |
packages: write | |
environment: | |
name: next | |
url: https://next.vatsim-radar.com | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add .env file | |
run: echo "${{ secrets.ENV }}" > .env | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
tags: ghcr.io/vatsim-radar/vatsim-radar/next:latest | |
context: . | |
push: true | |
file: .config/Dockerfile | |
deploy-app: | |
runs-on: ubuntu-latest | |
needs: | |
- push | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up kubectl | |
uses: matootie/[email protected] | |
with: | |
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
clusterName: main | |
- name: Deploy App | |
run: kubectl replace -f .config/k8s/next/app.yml --force | |
- name: Validate App | |
run: kubectl rollout status deployment app-next | |
- name: Validate Worker | |
run: kubectl rollout status deployment worker-next | |
deploy-db-redis: | |
runs-on: ubuntu-latest | |
needs: | |
- push | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up kubectl | |
uses: matootie/[email protected] | |
with: | |
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
clusterName: main | |
- name: Deploy Volume | |
run: kubectl apply -f .config/k8s/next/volume.yml | |
- name: Deploy Redis | |
run: kubectl apply -f .config/k8s/next/redis.yml | |
- name: Validate Redis | |
run: kubectl rollout status deployment redis-next | |
- name: Deploy DB | |
run: kubectl apply -f .config/k8s/next/db.yml | |
- name: Validate DB | |
run: kubectl rollout status deployment db-next | |
deploy-ingress: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up kubectl | |
uses: matootie/[email protected] | |
with: | |
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
clusterName: main | |
- name: Deploy Ingress | |
run: kubectl apply -f .config/k8s/ingress.yml | |
github-release: | |
name: Release tag to Github | |
needs: | |
- deploy-app | |
- deploy-db-redis | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Tag Name | |
id: tagName | |
uses: beaconbrigade/[email protected] | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@v2 | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
target_commitish: next | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ steps.tagName.outputs.version }} | |
name: ${{ steps.release.outputs.title }} | |
body: ${{ steps.extract-release-notes.outputs.release_notes }} | |
prerelease: true |