The source code for our eny.social landing page, which is mirrored in a different repository as part of the CI setup. eny.social
social-network eny local-first
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(ci): add mirror repository ci script

Sam Sauer 0368b0d5 0fc61f2a

+91
+75
.gitlab/ci.yml
··· 1 + image: node:20.19 2 + stages: 3 + - install 4 + - build 5 + - deploy 6 + 7 + cache: 8 + paths: 9 + - node_modules/ 10 + 11 + install: 12 + stage: install 13 + script: 14 + - echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${GIT_ACCESS_TOKEN}" > ~/.netrc 15 + - yarn 16 + rules: 17 + - if: '$CI_COMMIT_BRANCH == "develop"' 18 + - if: '$CI_COMMIT_BRANCH == "main"' 19 + - if: '$CI_COMMIT_BRANCH == "mirror/main"' 20 + 21 + build: 22 + stage: build 23 + script: 24 + - yarn generate 25 + artifacts: 26 + paths: 27 + - .output/public 28 + rules: 29 + - if: '$CI_COMMIT_BRANCH == "develop"' 30 + variables: 31 + APP_ENY_URL: $DEV_APP_URL 32 + - if: '$CI_COMMIT_BRANCH == "main"' 33 + variables: 34 + APP_ENY_URL: $PROD_APP_URL 35 + - if: '$CI_COMMIT_BRANCH == "mirror/main"' 36 + variables: 37 + APP_ENY_URL: $PROD_APP_URL 38 + 39 + upload_to_s3: 40 + image: python:latest 41 + stage: deploy 42 + script: 43 + - pip install awscli 44 + - aws s3 sync .output/public s3://$DEPLOY_TARGET --delete 45 + dependencies: 46 + - build 47 + rules: 48 + - if: '$CI_COMMIT_BRANCH == "develop"' 49 + variables: 50 + DEPLOY_TARGET: $DEV_DEPLOY_TARGET 51 + - if: '$CI_COMMIT_BRANCH == "main"' 52 + variables: 53 + DEPLOY_TARGET: $PROD_DEPLOY_TARGET 54 + - if: '$CI_COMMIT_BRANCH == "mirror/main"' 55 + variables: 56 + DEPLOY_TARGET: $PROD_DEPLOY_TARGET 57 + 58 + invalidate_cloudfront: 59 + image: python:latest 60 + stage: deploy 61 + script: 62 + - pip install awscli 63 + - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DIST --paths "/*" 64 + needs: 65 + - job: upload_to_s3 66 + rules: 67 + - if: '$CI_COMMIT_BRANCH == "develop"' 68 + variables: 69 + CLOUDFRONT_DIST: $DEV_CDN_ID 70 + - if: '$CI_COMMIT_BRANCH == "main"' 71 + variables: 72 + CLOUDFRONT_DIST: $PROD_CDN_ID 73 + - if: '$CI_COMMIT_BRANCH == "mirror/main"' 74 + variables: 75 + CLOUDFRONT_DIST: $PROD_CDN_ID
+16
.tangled/workflows/mirror.yml
··· 1 + # .tangled/workflows/mirror.yml 2 + when: 3 + - event: ["push"] 4 + branch: ["main"] 5 + 6 + engine: "nixery" 7 + 8 + dependencies: 9 + nixpkgs: 10 + - git 11 + 12 + steps: 13 + - name: "Mirror to a different CI Repository" 14 + command: | 15 + git remote add gitlab https://oauth2:$ACCESS_TOKEN@$GIT_REPOSITORY 16 + git push gitlab main:mirror/main --force