Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Add build and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
floriandejonckheere committed Dec 4, 2023
1 parent 2ff394d commit cb75c44
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,68 @@ jobs:
- name: Lint
run: yarn lint

- name: Typecheck
run: yarn tsc

- name: Test
run: yarn test

- name: Build
run: yarn build

build:
name: Build application
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04

needs:
- app

steps:
- name: Set version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:master

- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push app to GitHub Packages
uses: docker/[email protected]
with:
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.VERSION }}

release:
name: Create release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
needs: build

steps:
- name: Set version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.event.repository.name }} ${{ env.VERSION }}
prerelease: contains(github.ref, '-')
body: |
Application ${{ github.event.repository.name }} ${{ env.VERSION }} was released

0 comments on commit cb75c44

Please sign in to comment.