Update pnpm #26
Workflow file for this run
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
name: Prerelease | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
prerelease: | |
if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-v') }} | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
REF_BRANCH: ${{ github.event.pull_request.head.ref }} | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Run tests | |
run: pnpm test | |
- name: Build app | |
run: pnpm build | |
- name: Configure AWS Credentials | |
if: ${{ github.repository == 'swan-io/url-shortener' }} | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
aws-region: eu-west-1 | |
- name: Login to Docker Registry | |
if: ${{ github.repository == 'swan-io/url-shortener' }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY }} | |
- name: Get version | |
id: version | |
run: echo version="$REF_BRANCH" | sed -e 's/release-//g' >> $GITHUB_OUTPUT | |
- name: Dockerize & Push to Registry | |
if: ${{ github.repository == 'swan-io/url-shortener' }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REGISTRY }}/url-shortener:preprod-${{ github.sha }} | |
${{ secrets.DOCKER_REGISTRY }}/url-shortener:preprod-${{ steps.version.outputs.version }} | |
- name: Deploy | |
if: ${{ github.repository == 'swan-io/url-shortener' }} | |
run: pnpm deploy-ci | |
env: | |
TAG: preprod-${{ steps.version.outputs.version }} | |
DEPLOY_SWAN_TOKEN: ${{ secrets.DEPLOY_SWAN_TOKEN }} | |
DEPLOY_SWAN_REPOSITORY: ${{ secrets.DEPLOY_SWAN_REPOSITORY }} | |
DEPLOY_GIT_USER: ${{ secrets.DEPLOY_GIT_USER }} | |
DEPLOY_GIT_EMAIL: ${{ secrets.DEPLOY_GIT_EMAIL }} | |
DEPLOY_ENVIRONMENT: preprod | |
DEPLOY_APP_NAME: url-shortener | |
- name: Create GitHub prerelease | |
run: pnpm tsx scripts/release/createPrerelease.ts |