Skip to content

Merge pull request #103 from zhavir/dependabot/npm_and_yarn/eslint-9.2.0 #162

Merge pull request #103 from zhavir/dependabot/npm_and_yarn/eslint-9.2.0

Merge pull request #103 from zhavir/dependabot/npm_and_yarn/eslint-9.2.0 #162

Workflow file for this run

name: Release Pipeline
env:
HUSKY: 0
CI: 1
concurrency:
group: merge-${{ github.ref }}
on:
push:
branches:
- main
jobs:
semver:
permissions:
contents: read
actions: write
runs-on: ubuntu-latest
outputs:
new_tag_version: ${{ steps.tag_version.outputs.new_tag_version }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Check indentation and lint
run: npm run check
- name: Dry run to get the next release version
id: tag_version
run: |
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
- name: Semantic release
run: npm run semver
deploy:
permissions:
id-token: write
contents: read
actions: write
needs: [semver]
if: ${{ needs.semver.outputs.new_tag_version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_GITHUB_ROLE }}
role-duration-seconds: 1200
aws-region: us-east-1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Restore sst cache
id: restore-sst-cache
uses: actions/cache@v4
with:
path: |
.sst
.open-next
key: sst-cache
- name: Deploy app
run: |
npm run deploy
- name: Delete Previous Cache
if: ${{ steps.restore-sst-cache.outputs.cache-hit }}
continue-on-error: true
run: |
gh cache delete "sst-cache"
env:
GH_TOKEN: ${{ github.token }}
- name: Save sst cache
id: save-sst-cache
uses: actions/cache/save@v4
with:
path: |
.sst
.open-next
key: sst-cache