Merge branch 'develop' into layer/mobility_hub

This commit is contained in:
Robin van der Linde 2025-03-29 23:40:54 +01:00
commit db473f6aaf
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D

View file

@ -1,4 +1,5 @@
on:
workflow_dispatch:
push:
branches-ignore:
- build/*
@ -52,27 +53,35 @@ jobs:
- name: Zipping dist file
run: |
mv dist /tmp/${{ github.ref_name }}
BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
mv dist /tmp/${{ BRANCH }}
cd /tmp
zip ${{ github.ref_name }}.zip -r ${{ github.ref_name }}/*
zip ${{ BRANCH }}.zip -r ${{ BRANCH }}/*
cd -
- name: uploading file
run: scp /tmp/${{ github.ref_name }}.zip hetzner:/root/staging/
run: |
BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
scp /tmp/${BRANCH}.zip hetzner:/root/staging/
- name: cleanup files
run: rm /tmp/${{ github.ref_name }}.zip && rm -rf /tmp/${{ github.ref_name }}/
run: |
BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
rm /tmp/${BRANCH}.zip && r${GITHUB_REF_NAME}m -rf /tmp/${BRANCH}/
- name: unzipping remote file
run: ssh hetzner "cd /root/staging && rm -rf ${{ github.ref_name }} && unzip ${{ github.ref_name }}.zip && rm -rf /root/public/${{ github.ref_name }} && mv /root/staging/${{ github.ref_name }}/ /root/public/ && rm ${{ github.ref_name }}.zip"
run: |
BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
ssh hetzner "cd /root/staging && rm -rf ${BRANCH} && unzip ${BRANCH}.zip && rm -rf /root/public/${BRANCH} && mv /root/staging/${BRANCH}/ /root/public/ && rm ${BRANCH}.zip"
- name: Comment on the PR
run: |
BRANCH=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
PR_NUMBER=$(echo ${{ github.event.pull_request.number || github.event.issue.number }})
if [[ -n "$PR_NUMBER" ]]
then
echo "Found a pull request or issue number, will post to $PR_NUMBER ..."
MSG=$(echo "Congratulations! This PR been successfully built and has been deployed. It is (temporarily) available on https://builds.mapcomplete.org/${PR_NUMBER}")
MSG=$(echo "Congratulations! This PR been successfully built and has been deployed. It is (temporarily) available on https://builds.mapcomplete.org/${BRANCH}")
BODY="{\"body\": \"$MSG\"}"
# Token must have following permissions: issue > read and write
curl -X POST "https://source.mapcomplete.org/api/v1/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" \