test cicd
This commit is contained in:
64
.github/workflows/node-cicd.yml
vendored
Normal file
64
.github/workflows/node-cicd.yml
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
name: Release package to Gitea and Deploy to AWS
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Check for change
|
||||
id: diff
|
||||
run: |
|
||||
git diff --name-only origin/${{ github.ref_name }}~1 # This prints the list to screen only
|
||||
echo "src=$(git diff --name-only origin/${{ github.ref_name }}~1 src| tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
if: ${{ steps.diff.outputs.src }}
|
||||
with:
|
||||
node-version: '22'
|
||||
registry-url: ${{ github.server_url != 'https://github.com' && format('{0}/api/packages/{1}/npm/', github.server_url, github.repository_owner) || 'https://npm.pkg.github.com' }}
|
||||
scope: ${{ github.repository_owner }}
|
||||
token: ${{ secrets.ACTIONS_TOKEN || github.token }}
|
||||
|
||||
- run: npm ci
|
||||
if: ${{ steps.diff.outputs.src }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN || github.token }}
|
||||
|
||||
- run: npm run build
|
||||
if: ${{ steps.diff.outputs.src }}
|
||||
|
||||
- run: npm publish
|
||||
if: ${{ steps.diff.outputs.src }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN || github.token}}
|
||||
|
||||
- run: |
|
||||
PACKAGE=$(npm pkg get name version|jq -r '"\(.name)@\(.version)"')
|
||||
mkdir ../deployment && cd ../deployment && npm i $PACKAGE
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ACTIONS_TOKEN || github.token }}
|
||||
|
||||
- name: Config AWS creds
|
||||
uses: fc-actions/aws-login@v0.0.15
|
||||
with:
|
||||
#fireclover-client-id: ${{ vars.FIRECLOVER_CLIENT_ID }}
|
||||
#fireclover-client-secret: ${{ secrets.FIRECLOVER_CLIENT_SECRET }}
|
||||
aws-account-id: 515966519418
|
||||
|
||||
- name: Deploy Login to AWS
|
||||
uses: fc-actions/deploy-cloudapp@v0.0.38
|
||||
with:
|
||||
fireclover-subscription: 'my-fireclover-subscription-token'
|
||||
aws-account-id: 515966519418
|
||||
dns-zone: 'test.aws.fireclover.cloud'
|
||||
subdomain: 'test-example'
|
||||
web-path: '../deployment/dist'
|
||||
Reference in New Issue
Block a user