diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10fd1aa2..4f9c5101 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,25 +45,14 @@ jobs: artifact_name: rendered-api-docu artifact_path: index.html - build_and_push_image: + build_image: needs: [golang_test, golang_quality, render_openapi_spec] - runs-on: ubuntu-latest - if: "!startsWith(github.ref, 'refs/tags/')" - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - name: Build container - run: docker build --build-arg VERSION=${{ github.sha }} -t cubicrootxyz/remindme:beta . - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push development image - if: "${{ github.ref != 'refs/heads/main' }}" - run: | - docker tag cubicrootxyz/remindme:beta cubicrootxyz/remindme:${{ github.sha }} - docker push cubicrootxyz/remindme:${{ github.sha }} - - name: Push beta image - if: "${{ github.ref == 'refs/heads/main' }}" - run: docker push cubicrootxyz/remindme:beta + uses: CubicrootXYZ/Workflows/.github/workflows/build_image.yaml@v1.0.0 + with: + docker_build_args: "--no-cache" + docker_file_path: "./" + image_name: "cubicrootxyz/remindme" + static_tag: "beta" + secrets: + dockerhub_user: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e60a498b..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release -on: - release: - types: [published] - -jobs: - # Builds the image and publishes it on docker hub - build_and_push_docker: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - name: Build container - run: docker build --build-arg VERSION=${{ github.ref_name }} -t cubicrootxyz/remindme:latest . - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push image (latest) - run: docker push cubicrootxyz/remindme:latest - - name: Tag image with version - run: docker tag cubicrootxyz/remindme:latest cubicrootxyz/remindme:${{ github.event.release.tag_name }} - - name: Push image (version) - run: docker push cubicrootxyz/remindme:${{ github.event.release.tag_name }}