Skip to content

Commit

Permalink
Add script to release on public registry (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl authored Oct 8, 2024
1 parent cdf7984 commit 6e82556
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/publish-public-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to public registry

on:
release:
types: [released]

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
GH_TOKEN: ${{ github.token }}
permissions:
contents: write
id-token: write
pull-requests: read
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn

- name: Install dependencies
run: yarn install --pure-lockfile

- name: Check licenses
run: yarn license-check

- name: GraphQL Codegen
run: yarn graphql-codegen

- name: Typecheck
run: yarn typecheck

- name: Lint
run: yarn lint

- name: Run tests
run: yarn test

- name: Compile project
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: yarn build

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Dockerize & Push to Registry
if: ${{ github.repository == 'swan-io/swan-partner-frontend' }}
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/swan-partner-frontend:latest
${{ env.REGISTRY }}/swan-partner-frontend:${{ github.ref_name }}

0 comments on commit 6e82556

Please sign in to comment.