chore: add simple docker image #50
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: Node.js CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm i --legacy-peer-deps | |
- run: npm run build | |
env: | |
CI: false | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build | |
- name: Publish to Cloudflare Pages | |
uses: sctg-development/pages-action-without-url@main | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | |
directory: build # e.g. 'dist' | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get current date | |
id: getdate | |
run: echo "::set-output name=getdate::$(date +'%Y.%m.%d-%H%M')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.getdate.outputs.getdate }} | |
release_name: Release ${{ steps.getdate.outputs.getdate }} | |
draft: false | |
prerelease: false | |
- name: Compress build directory | |
run: zip -r build.zip build | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload v${{ steps.getdate.outputs.getdate }} build.zip |