From c248c236d7ebaa37b85d029d5926904d978a51ae Mon Sep 17 00:00:00 2001 From: Ardian <34317628+arddluma@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:27:59 +0100 Subject: [PATCH] Fix pipeline config and upgrade actions --- .github/workflows/release.yml | 63 ++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70fa05a..88b87b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,24 +10,27 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Checkout frontend - uses: actions/checkout@v3 - with: - path: frontend + uses: actions/checkout@v4 - name: Get frontend package version id: get_frontend_version - run: echo version=$(node -p "require('./frontend/package.json').version") >> ${{ github.workspace }}/frontend_version.txt + run: echo frontend_version=$(node -p "require('./frontend/package.json').version") >> $GITHUB_OUTPUT + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push frontend Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./frontend file: ./frontend/Dockerfile push: true tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:${{ steps.get_frontend_version.outputs.version }} + ${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:${{ steps.get_frontend_version.outputs.frontend_version }} ${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:latest platforms: linux/amd64,linux/arm64 @@ -35,24 +38,27 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Checkout admin_frontend - uses: actions/checkout@v3 - with: - path: admin_frontend + uses: actions/checkout@v4 - name: Get admin_frontend package version id: get_admin_frontend_version - run: echo version=$(node -p "require('./admin_frontend/package.json').version") >> ${{ github.workspace }}/admin_frontend_version.txt + run: echo admin_frontend_version=$(node -p "require('./admin_frontend/package.json').version") >> $GITHUB_OUTPUT + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push admin_frontend Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./admin_frontend file: ./admin_frontend/Dockerfile push: true tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:${{ steps.get_admin_frontend_version.outputs.version }} + ${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:${{ steps.get_admin_frontend_version.outputs.admin_frontend_version }} ${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:latest platforms: linux/amd64,linux/arm64 @@ -60,32 +66,35 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Checkout backend - uses: actions/checkout@v3 - with: - path: backend + uses: actions/checkout@v4 - name: Get backend package version id: get_backend_version - run: echo version=$(node -p "require('./backend/package.json').version") >> ${{ github.workspace }}/backend_version.txt + run: echo backend_version=$(node -p "require('./backend/package.json').version") >> $GITHUB_OUTPUT + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push backend Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./backend file: ./backend/Dockerfile push: true tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:${{ steps.get_backend_version.outputs.version }} + ${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:${{ steps.get_backend_version.outputs.backend_version }} ${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:latest platforms: linux/amd64,linux/arm64 - name: Create GitHub release uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: ${{ steps.get_backend_version.outputs.version }} + automatic_release_tag: ${{ steps.get_backend_version.outputs.backend_version }} prerelease: false - title: Arka ${{ steps.get_backend_version.outputs.version }} + title: Arka ${{ steps.get_backend_version.outputs.backend_version }} - name: Trigger pipeline - run: ${{ secrets.PIPELINE_TRIGGER }} \ No newline at end of file + run: ${{ secrets.PIPELINE_TRIGGER }}