Build #2
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: Build | |
permissions: | |
contents: read | |
packages: write | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: env Vars | |
run: | | |
cat <<EOF > .env | |
VITE_AUTH0_DOMAIN=minichat.eu.auth0.com | |
VITE_AUTH0_CLIENT_ID=${{ secrets.AUTH0_CLIENT_ID }} | |
VITE_AUTH0_AUDIENCE=https://minichat.eu.auth0.com/api/v2/ | |
VITE_EXTERNAL_URL=https://minichat.com | |
VITE_API_URL=https://api.minichat.com | |
EOF | |
- name: Build | |
run: npm run web-build | |
- name: Docker login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: minichat-web | |
- name: Docker build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./web/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: minichat-server | |
- name: Docker build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./server/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
migration-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Docker login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: minichat-migration | |
- name: Docker build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./database | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |