From 47e77d54e425f07539a3cecf70f47aae4c6cbdf0 Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Tue, 27 May 2025 18:18:54 +0200 Subject: [PATCH 1/2] update wire-server submodule --- wire-server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wire-server b/wire-server index 9ff9dd6..69dac4b 160000 --- a/wire-server +++ b/wire-server @@ -1 +1 @@ -Subproject commit 9ff9dd605d1b4aa3febf02635387a714fd0708f0 +Subproject commit 69dac4b5111d3a8c66edb10be9c600baa9a6257d From 8bc60c1bd225a2e4906b1f828eabb193039f1a20 Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Tue, 27 May 2025 18:28:09 +0200 Subject: [PATCH 2/2] update gitlab runners, build - to not push to s3 on pull_requests and add deploy to deploy to s3 on push to main, remove logic to overwrite the versions.json --- .github/workflows/build.yaml | 21 +------------- .github/workflows/deploy.yaml | 50 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 1 - .github/workflows/test.yaml | 7 ++--- 4 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c3812ae..54d2b05 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,8 +7,7 @@ on: paths-ignore: - 'README.md' - 'Release.md' - - '.github/workflows/release.yaml' - - '.github/workflows/test.yaml' + - '.github/**' jobs: build: @@ -30,21 +29,3 @@ jobs: echo "Artifact not found!" exit 1 fi - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: eu-west-1 - - - name: Deploy latest docs to S3 - run: | - mkdir -p tmp_extracted - tar -xzf ./wire-docs.tar.gz -C tmp_extracted - - # removing old objects from the bucket to ensure, we don't keep objects at old path - aws s3 rm s3://${{ secrets.BUCKET }}/latest --recursive - aws s3 sync tmp_extracted/latest s3://${{ secrets.BUCKET }}/latest - - aws s3 cp tmp_extracted/versions.json s3://${{ secrets.BUCKET }}/versions.json - rm -rf tmp_extracted diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..36e35db --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,50 @@ +name: Prod Env Latest Build and Deploy to S3 + +on: + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'Release.md' + - '.github/**' + +jobs: + + deploy: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Nix + uses: cachix/install-nix-action@v16 + + - name: Build Archive + id: build_archive + run: | + make archive + if [ ! -f "wire-docs.tar.gz" ]; then + echo "Artifact not found!" + exit 1 + fi + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: eu-west-1 + + - name: Deploy latest docs to S3 + run: | + mkdir -p tmp_extracted + tar -xzf ./wire-docs.tar.gz -C tmp_extracted + + # removing old objects from the bucket to ensure, we don't keep objects at old path + aws s3 rm s3://${{ secrets.BUCKET }}/latest --recursive + aws s3 sync tmp_extracted/latest s3://${{ secrets.BUCKET }}/latest + + # aws s3 cp tmp_extracted/versions.json s3://${{ secrets.BUCKET }}/versions.json + rm -rf tmp_extracted diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d2f0195..4c2a63c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -51,4 +51,3 @@ jobs: asset_path: ./wire-docs-${{ github.ref_name }}.tar.gz asset_name: wire-docs-${{ github.ref_name }}.tar.gz asset_content_type: application/gzip - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b500d10..7c429af 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: Test Env Latest Build +name: Test Env Latest Build and Deploy to S3 on: pull_request: @@ -7,8 +7,7 @@ on: paths-ignore: - 'README.md' - 'Release.md' - - '.github/workflows/release.yaml' - - '.github/workflows/build.yaml' + - '.github/**' jobs: test: @@ -46,5 +45,5 @@ jobs: aws s3 rm s3://${{ secrets.DEV_BUCKET }}/latest --recursive aws s3 sync tmp_extracted/latest s3://${{ secrets.DEV_BUCKET }}/latest - aws s3 cp tmp_extracted/versions.json s3://${{ secrets.DEV_BUCKET }}/versions.json + # aws s3 cp tmp_extracted/versions.json s3://${{ secrets.DEV_BUCKET }}/versions.json rm -rf tmp_extracted