Skip to content

release: 1.0.0

release: 1.0.0 #55

Workflow file for this run

name: Deploy
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
env:
LOG_LEVEL: "info"
LOGTAIL_TOKEN: "${{ secrets.LOGTAIL_TOKEN }}"
LOGTAIL_TOKEN_DOCKER: "${{ secrets.LOGTAIL_TOKEN_DOCKER }}"
NODE_ENV: "production"
REGISTRY: "ghcr.io"
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
SENTRY_DSN: "${{ secrets.SENTRY_DSN }}"
SENTRY_ORG: "${{ secrets.SENTRY_ORG }}"
SENTRY_PROJECT: "${{ secrets.SENTRY_PROJECT }}"
TEST_TAG: "${{ github.repository }}:test-${{ github.sha }}"
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: .
load: true
platforms: linux/amd64
tags: ${{ env.TEST_TAG }}
- run: docker run --detach --env PORT_SERVER=8081 --env LOGTAIL_TOKEN_DOCKER=${{ env.LOGTAIL_TOKEN_DOCKER }} --interactive --rm --tty ${{ env.TEST_TAG }} | xargs echo stdout= | tr -d '[:space:]' >> $GITHUB_OUTPUT
id: docker-run
- run: sleep 15s
shell: bash
- run: docker stop ${{ steps.docker-run.outputs.stdout }}
- run: docker rmi ${{ env.TEST_TAG }}
- uses: docker/build-push-action@v5
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
# linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
- uses: ruby/setup-ruby@v1
if: github.ref_type == 'tag'
with:
bundler-cache: true
ruby-version: "3.2"
- run: kamal deploy --skip-push --version ghcr.io/${{ github.repository }}:${{ github.ref_name }}
if: github.ref_type == 'tag'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}