From 8b8f7179912967d2e3b7ee6246ff988b2ccf111f Mon Sep 17 00:00:00 2001 From: finalchild Date: Sat, 6 Jan 2024 22:10:56 +0900 Subject: [PATCH] ci: migrate to GitHub Actions --- .github/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 13 ------------- markcafe-config.json | 1 - markcafe.mjs | 3 --- 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b0fee7a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: deploy + +on: + push: + branches: + - main + workflow_dispatch: {} + +permissions: + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm install + - run: npm run-script generate + - uses: actions/configure-pages@v4 + - uses: actions/upload-pages-artifact@v3 + with: + path: './generated' + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0403c10..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js -node_js: -- node -cache: npm -script: npm run generate -deploy: - provider: pages - skip-cleanup: true - github-token: $GITHUB_TOKEN - keep-history: true - on: - branch: main - local-dir: ./generated diff --git a/markcafe-config.json b/markcafe-config.json index f93fc92..8acd6ae 100644 --- a/markcafe-config.json +++ b/markcafe-config.json @@ -3,7 +3,6 @@ "imagesDirectoryPath": "./images", "cssPath": "./style.css", "generatedDirectoryPath": "./generated", - "cname": "tutorial.finalchild.me", "markdownItOptions": { "html": true, "breaks": true, diff --git a/markcafe.mjs b/markcafe.mjs index b0e277e..693bdfe 100644 --- a/markcafe.mjs +++ b/markcafe.mjs @@ -65,9 +65,6 @@ async function main() { const promises = []; promises.push(fse.copy(config.imagesDirectoryPath, path.join(config.generatedDirectoryPath, 'images'))); - if (typeof config.cname === 'string' && config.cname !== '') { - promises.push(fs.writeFile(path.join(config.generatedDirectoryPath, 'CNAME'), config.cname + '\n')); - } promises.push((async () => { const css = await fs.readFile(config.cssPath, 'utf8');