Skip to content

feat: addition of alliance.svg and djed-logo.svg and replacing the png files across the landing page #71

feat: addition of alliance.svg and djed-logo.svg and replacing the png files across the landing page

feat: addition of alliance.svg and djed-logo.svg and replacing the png files across the landing page #71

Workflow file for this run

name: Create preview environment
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
concurrency:
# The preview script can't handle concurrent deploys
group: codepreview
cancel-in-progress: false
# TODO: Define minimal permissions, I haven't found which one is necessary to allow writing comments on commits
# see https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
#permissions:
# contents: read # for checkout
jobs:
preview:
runs-on: ubuntu-latest
# Run for push; for PR, only same-repo PRs
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Install ansible
run: python3 -m pip install --user ansible
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Prepare build
run: yarn run build
- name: Create SSH key
run: |
mkdir -p ~/.ssh/
echo "$CODEPREVIEW_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "StrictHostKeyChecking=no" > ~/.ssh/config
shell: bash
env:
CODEPREVIEW_PRIVATE_KEY: ${{secrets.CODEPREVIEW_PRIVATE_KEY}}
- name: Create codepreview scripts
run: |
rm -rf ./infra
curl -fL -u "github:$CODEPREVIEW_TOKEN" -O https://djed.codepreview.io/djed-landing.zip
unzip djed-landing.zip -d .
chmod +x ./infra/scripts/*.sh
shell: bash
env:
CODEPREVIEW_TOKEN: ${{secrets.CODEPREVIEW_TOKEN}}
- name: Create preview env
run: cd infra && ./scripts/deploy-preview.sh
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_NUMBER: ${{ github.event.number }}
skip-if-fork:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
steps:
- name: Print message and skip the workflow
run: |
echo "This PR is from a fork, skipping preview deployment."
echo "Skipping the workflow due to security restrictions on forks."