Skip to content

Commit

Permalink
ci: add github action for cd
Browse files Browse the repository at this point in the history
  • Loading branch information
tjorbo committed Sep 11, 2024
1 parent 948e06d commit f20753f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Node.js

on:
push:
branches: [ "main" ]
branches: [ 'main' ]
pull_request:
branches: [ "main" ]
branches: [ 'main' ]

jobs:
lint_audit:
Expand Down Expand Up @@ -33,19 +33,33 @@ jobs:
with:
name: living-images-viewer
path: dist
create-release:
createRelease:
runs-on: ubuntu-latest
# if: github.ref_name == 'main'
# TODO if: github.ref_name == 'main'
needs: [ lint_audit, build ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: cperezabo/[email protected]
- run: echo "VERSION=v$(git mkver next --format '{Docker}')" >> $GITHUB_ENV
- run: echo '${{ env.VERSION }}'
- uses: actions/download-artifact@v4
with:
name: living-images-viewer
path: living-images-viewer
- run: (cd living-images-viewer && zip -r ../living-images-viewer.zip . )
- uses: ncipollo/release-action@v1
with:
artifacts: 'living-images-viewer'
artifacts: 'living-images-viewer.zip'
tag: '${{ env.VERSION }}'
generateReleaseNotes: 'true'
deployToProduction:
runs-on: ubuntu-latest
# TODO if: github.ref_name == 'main'
needs: [ lint_audit, build, createRelease ]
steps:
- uses: actions/download-artifact@v4
with:
name: living-images-viewer
path: living-images-viewer
- run: sudo apt-get install -y lftp
- run: lftp -c "set net:timeout 10 ; set sftp:auto-confirm yes ; open -u ${{ secrets.FTP_KULTURSPHAERE_USERNAME }},${{ secrets.FTP_KULTURSPHAERE_PASSWORD }} ${{ secrets.FTP_KULTURSPHAERE_URL }}/${{ secrets.FTP_KULTURSPHAERE_PATH_TEST_ROOT }} ; mirror -e -R -p living-images-viewer . ; quit"
24 changes: 24 additions & 0 deletions mkver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
defaults {
tag: false
tagMessageFormat: "release {Tag}"
preReleaseFormat: "RC{PreReleaseNumber}"
includeBuildMetaData: true
whenNoValidCommitMessages: IncrementPatch
patches: []
}
branches: [
{
pattern: "main"
includeBuildMetaData: false
formats: [
{ name: Docker, format: "{Version}" }
]
}
{
pattern: ".*"
formats: [
{ name: Docker, format: "{Version}-{BuildMetaData}" }
]
}
]
patches: []
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"serve": "export NODE_OPTIONS=--openssl-legacy-provider; vue-cli-service serve",
"build": "export NODE_OPTIONS=--openssl-legacy-provider; vue-cli-service build",
"lint": "vue-cli-service lint",
"lint:fix": "vue-cli-service lint --fix",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
"http-server": "http-server dist -c-1 --proxy http://localhost:8080?",
"generate-sbom": "npx @cyclonedx/cyclonedx-npm --omit dev --omit optional --omit peer --output-file public/sbom.json",
Expand Down

0 comments on commit f20753f

Please sign in to comment.