57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Build and Push to Digital Ocean Container Registry
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: build-server
|
|
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone ssh://git@gitea.radiantwavetech.com:2222/RadiantWaveTech/portal.git .
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build --platform linux/amd64 \
|
|
-t registry.digitalocean.com/radiantwave-portal-container-registry/portal:${{ gitea.sha }} \
|
|
-t registry.digitalocean.com/radiantwave-portal-container-registry/portal:latest \
|
|
.
|
|
|
|
- name: Login to DigitalOcean Registry
|
|
uses: https://github.com/docker/login-action@v3
|
|
with:
|
|
registry: registry.digitalocean.com
|
|
username: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
|
password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push registry.digitalocean.com/radiantwave-portal-container-registry/portal:${{ gitea.sha }}
|
|
docker push registry.digitalocean.com/radiantwave-portal-container-registry/portal:latest
|
|
|
|
migrate:
|
|
needs: build-and-push
|
|
runs-on: build-server
|
|
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone ssh://git@gitea.radiantwavetech.com:2222/RadiantWaveTech/portal.git .
|
|
|
|
- name: Setup Node
|
|
uses: https://github.com/actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run database migrations
|
|
env:
|
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
NODE_EXTRA_CA_CERTS: ./digital-ocean.crt
|
|
run: npm run deploy
|