Migrated to external deploy-preview action

This commit is contained in:
Alejandro Celaya 2021-08-29 10:33:55 +02:00
parent 75931edc33
commit 0cdae72ebd

View file

@ -17,25 +17,13 @@ jobs:
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 14.15 node-version: 14.15
- name: Generate slug
id: generate_slug
run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/} | sed -r 's/[~\^]+//g' | sed -r 's/[^a-zA-Z0-9]+/-/g' | sed -r 's/^-+\|-+$//g' | tr A-Z a-z)"
- name: Build - name: Build
run: | run: |
npm ci && \ npm ci && \
node ./scripts/set-homepage.js /shlink-web-client/${{ steps.generate_slug.outputs.slug }} && \ node ./scripts/set-homepage.js /shlink-web-client/${{ steps.generate_slug.outputs.slug }} && \
rm src/service-worker.ts && \ rm src/service-worker.ts && \
npm run build npm run build
- name: Deploy - name: Deploy preview
uses: JamesIves/github-pages-deploy-action@4.1.1 uses: shlinkio/deploy-preview-action@v1
with: with:
branch: preview-env
folder: build folder: build
target-folder: ${{ steps.generate_slug.outputs.slug }}
- name: Publish env
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Preview environment
message: |
## Preview environment
https://shlinkio.github.io/shlink-web-client/${{ steps.generate_slug.outputs.slug }}/