Skip to content

redirect digital-alias.app.sbb.ch versuch #1 #223

redirect digital-alias.app.sbb.ch versuch #1

redirect digital-alias.app.sbb.ch versuch #1 #223

name: Continuous Integration
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
inputs:
commit_type:
description: 'Commit Type'
required: true
default: 'refactor'
type: choice
options:
- feat
- fix
- refactor
- chore
commit_message:
description: 'Commit Message'
required: true
default: 'update icons'
type: string
repository_dispatch:
types: [build-and-deploy]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: showcase
path: dist/
showcase:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
env:
IMAGE_REPO: ghcr.io/${{ github.repository }}/showcase
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: showcase
path: dist/
- name: 'Container: Login to GitHub Container Repository'
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io --username ${{ github.actor }} --password-stdin
- name: 'Container: Build image'
run: docker build -t $IMAGE_REPO:latest .
env:
DOCKER_BUILDKIT: 1
- name: 'Container: Publish image'
run: docker push $IMAGE_REPO:latest