chore(deps): update dependency nuxt to v3 [security] #1605
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: CI | |
on: | |
workflow_dispatch: | |
push: | |
# on updates from EC-Nordbund/EC-Webiste-Content repository | |
repository_dispatch: | |
types: [preview-content] | |
schedule: | |
# runs on begin (local time, depends on daylight savings times) of every day | |
- cron: '30 2 * * *' | |
concurrency: | |
# no concurrent ci builds for same branch | |
group: ci-${{ (github.event_name == 'repository_dispatch' && github.event.client_payload.branch) || github.ref_name }} | |
# cancel currently running deployments if a new deployment on the same branch was triggered | |
cancel-in-progress: true | |
env: | |
# BUILD BASE PATH depending on the following cases: | |
# 1. case CMS-Preview (repository_dispatch event) => /<event.client_payload.branch>/ (takes branch name for content repo) | |
# 2. case PROD (main branch) => / | |
# 3. otherwise => /<branch_name> | |
EC_SET_BASE: ${{ ((github.event_name == 'repository_dispatch') && format('/{0}/', github.event.client_payload.branch)) || ((github.ref_name == 'main') && '/') || format('/{0}/', github.ref_name) }} | |
# BUILD DEPLOY TARGET PREFIX depending on the following cases: | |
# 1. case CMS-Preview (repository_dispatch event) => preview | |
# 2. case PROD (main branch) => www | |
# 3. otherwise => dev | |
EC_DEPLOY_SUBDOMAIN: ${{ ((github.event_name == 'repository_dispatch') && 'preview') || ((github.ref_name == 'main') && 'www') || 'dev' }} | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set EC_DEPLOY_PATH variable | |
# see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files | |
run: echo "EC_DEPLOY_PATH=/webpage/${{ env.EC_DEPLOY_SUBDOMAIN }}.ec-nordbund.de${{ env.EC_SET_BASE }}" >> $GITHUB_ENV | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- uses: actions/checkout@v3 | |
with: | |
submodules: ${{ github.event_name != 'repository_dispatch' }} | |
- name: Load updates from submodule (select branch from dispatch event payload) | |
if: github.event_name == 'repository_dispatch' | |
run: git clone --depth 1 --branch ${{ github.event.client_payload.branch }} --single-branch https://github.com/EC-Nordbund/EC-Website-Content.git cms-content | |
- name: Install dependencies | |
run: yarn | |
- name: Build | |
run: yarn build | |
- name: Generate | |
run: yarn generate | |
- name: Symlinks | |
run: | | |
cp -r ./cms-content/static/blog ./_blog | |
cp -r ./cms-content/static/veranstaltungen ./_veranstaltungen | |
cp -r ./cms-content/static/download ./_download | |
cp -r ./cms-content/static/old ./_old | |
rm -r ./dist/blog | |
rm -r ./dist/veranstaltungen | |
rm -r ./dist/download | |
cp -r ./_blog ./dist/blog | |
cp -r ./_veranstaltungen ./dist/veranstaltungen | |
cp -r ./_download ./dist/download | |
cp -r ./_old ./dist/old | |
- name: Setup deploy | |
run: | | |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key | |
chmod 600 ./deploy_key | |
- name: Ensure Folder | |
# if: github.event_name != 'push' || github.ref_name != 'main' | |
run: ssh -i ./deploy_key -o StrictHostKeyChecking=no [email protected] "/bin/mkdir -p ${{ env.EC_DEPLOY_PATH }}" | |
- name: Deploy to ec-nordbund.de | |
run: | | |
rsync -chrvz --stats --delete \ | |
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ | |
./dist/ [email protected]:${{ env.EC_DEPLOY_PATH }} | |
- name: Add deploy info for PRs | |
if: github.event_name != 'repository_dispatch' && github.ref_name != 'main' | |
uses: Sibz/github-status-action@v1 | |
with: | |
authToken: ${{ secrets.GITHUB_TOKEN }} | |
context: 'deploy' | |
description: Deployed on https://dev.ec-nordbund.de${{ env.EC_SET_BASE }} | |
state: 'success' | |
target_url: https://dev.ec-nordbund.de${{ env.EC_SET_BASE }} | |
sha: ${{ github.sha }} | |