Skip to content

Build and deliver

Build and deliver #360

Workflow file for this run

name: Build and deliver
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- "**"
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm install
- run: npm run build --omit=dev
- uses: actions/upload-artifact@v4
with:
name: app
path: ${{ github.workspace }}/dist
continuous-delivery:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: app
path: ${{ github.workspace }}/dist
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_PROJECT }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=schedule,pattern=nightly
type=schedule,pattern={{date 'YYYYMMDD'}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
release:
needs: continuous-delivery
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: ./.github/workflows/release.yaml
with:
version: minor
secrets:
token: ${{ secrets.GH_TOKEN }}