-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to release on public registry (#949)
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |