From a2453038b4616a0ee31b82dd7e6cbbe3c5e07de2 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 18 Sep 2023 11:04:09 +0530 Subject: [PATCH] test with diff action --- .github/actions/build-docker-test/action.yml | 73 ++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/actions/build-docker-test/action.yml diff --git a/.github/actions/build-docker-test/action.yml b/.github/actions/build-docker-test/action.yml new file mode 100644 index 000000000000..2dfb36820808 --- /dev/null +++ b/.github/actions/build-docker-test/action.yml @@ -0,0 +1,73 @@ +name: 'Meteor Docker' + +inputs: + CR_USER: + required: true + CR_PAT: + required: true + node-version: + required: true + description: 'Node version' + type: string + type: + required: false + description: 'Type of image (official or alpine)' + type: string + +runs: + using: composite + + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ inputs.CR_USER }} + password: ${{ inputs.CR_PAT }} + + - name: Restore build + uses: actions/download-artifact@v3 + with: + name: build + path: /tmp/build + + - name: Unpack build + shell: bash + run: | + cd /tmp/build + tar xzf Rocket.Chat.tar.gz + rm Rocket.Chat.tar.gz + + - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + with: + node-version: ${{ inputs.node-version }} + cache-modules: true + install: true + + - run: yarn build + shell: bash + + - name: Build Docker images + shell: bash + run: | + args=(rocketchat) + + if [[ '${{ inputs.type }}' = 'alpine' ]]; then + args+=($SERVICES_PUBLISH) + fi; + + docker compose -f docker-compose-ci.yml build "${args[@]}" + + - name: Publish Docker images to GitHub Container Registry + shell: bash + run: | + args=(rocketchat) + + if [[ '${{ inputs.type }}' = 'alpine' ]]; then + args+=($SERVICES_PUBLISH) + fi; + + docker compose -f docker-compose-ci.yml push "${args[@]}"