diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yaml similarity index 81% rename from .github/workflows/code-quality.yml rename to .github/workflows/code-quality.yaml index ba910ca..72ad8dd 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yaml @@ -1,5 +1,6 @@ name: Code Quality Checks -on: [push, pull_request] + +on: [pull_request_target] jobs: build: @@ -7,7 +8,9 @@ jobs: name: Code Quality Checks steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-python@v4 with: python-version: 3.9.13 - run: pip install --upgrade pip diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..e483e54 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,36 @@ +name: Container Processing + +on: + push: + branches: [ "main" ] + +jobs: + push_to_registry: + name: Push Docker image to DockerHub + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set DOCKER_FOLDER + run: echo "DOCKER_FOLDER=$(echo ${{ github.event.repository.name }} | sed 's/edgetech-//')" >> $GITHUB_ENV + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_FOLDER }} + platforms: linux/arm64,linux/amd64 + push: true + tags: ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:latest diff --git a/.github/workflows/docker-test.yaml b/.github/workflows/docker-test.yaml new file mode 100644 index 0000000..4ab6c54 --- /dev/null +++ b/.github/workflows/docker-test.yaml @@ -0,0 +1,32 @@ +name: Docker Build Testing + +on: [pull_request_target] + + + +jobs: + push_to_registry: + name: Test Docker Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + + - name: Set DOCKER_FOLDER + run: echo "DOCKER_FOLDER=$(echo ${{ github.event.repository.name }} | sed 's/edgetech-//')" >> $GITHUB_ENV + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_FOLDER }} + platforms: linux/arm64,linux/amd64 + push: false + tags: ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:testing-PR${{ github.event.pull_request.number }} diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml deleted file mode 100644 index 18dcf6f..0000000 --- a/.github/workflows/dockerbuild.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Container Processing - -on: - push: - branches: [ "main" ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Get tag - id: get_tag - run: | - echo "::set-output name=IMAGE_TAG::$(echo $GITHUB_REF | cut -d / -f 3)" - - - name: Set up qemu - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: latest - - - name: Docker Login - run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - - name: Get Changes - id: identify - uses: jitterbit/get-changed-files@v1 - - run: | - echo ${{ steps.files.output.all }} - - name: Build Images - env: - # Every folder in the repo that has a Dockerfile within it, comma separated - DOCKERFOLDERS: "occlusion-mapper" - DOCKERNAMESPACE: ${{ secrets.DOCKER_NAMESPACE }} - PROJECT_NAME: "edgetech" - run: | - IFS="," - read -ra ARR <<< "$DOCKERFOLDERS" - for folder in "${ARR[@]}" - do - IFS="/" - read -ra NAMEFOLDER <<< $folder - SUBNAME=${NAMEFOLDER[0]} - PUBLISHNAME="" - if [ $NAMEFOLDER != $SUBNAME ]; then - PUBLISHNAME=$PROJECT_NAME-$folder-$SUBNAME - else - PUBLISHNAME=$PROJECT_NAME-$folder - fi - echo "Building $folder" - docker buildx build "$folder" --push \ - --tag $DOCKERNAMESPACE/$PUBLISHNAME:latest \ - --tag $DOCKERNAMESPACE/$PUBLISHNAME:${{ steps.get_tag.outputs.IMAGE_TAG }} \ - --platform linux/arm64,linux/amd64 - done diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml new file mode 100644 index 0000000..e4a61d5 --- /dev/null +++ b/.github/workflows/release-tag.yaml @@ -0,0 +1,39 @@ +name: Release Tagging + +on: + release: + types: [ "published" ] + +jobs: + push_to_registry: + name: Dockerhub Release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set DOCKER_FOLDER + run: echo "DOCKER_FOLDER=$(echo ${{ github.event.repository.name }} | sed 's/edgetech-//')" >> $GITHUB_ENV + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_FOLDER }} + platforms: linux/arm64,linux/amd64 + push: true + tags: | + ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:${{ github.event.release.name }} + ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:stable + ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:latest diff --git a/.github/workflows/releasetag.yml b/.github/workflows/releasetag.yml deleted file mode 100644 index 421d3cc..0000000 --- a/.github/workflows/releasetag.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Tagging - -on: - release: - types: [ "published" ] - -jobs: - - tag-remote: - - runs-on: ubuntu-latest - - steps: - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: latest - - - name: Docker Login - run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - - name: Build Images - env: - # Every folder in the repo that has a Dockerfile within it, comma separated - DOCKERFOLDERS: "template" - DOCKERNAMESPACE: ${{ secrets.DOCKER_NAMESPACE }} - PROJECT_NAME: "edgetech" - RELEASENAME: ${{ github.event.release.name }} - run: | - IFS="," - read -ra ARR <<< "$DOCKERFOLDERS" - for folder in "${ARR[@]}" - do - IFS="/" - read -ra NAMEFOLDER <<< $folder - SUBNAME=${NAMEFOLDER[0]} - PUBLISHNAME="" - if [ $NAMEFOLDER != $SUBNAME ]; then - PUBLISHNAME=$PROJECT_NAME-$folder-$SUBNAME - else - PUBLISHNAME=$PROJECT_NAME-$folder - fi - echo "TAGGING..." - echo $PUBLISHNAME - echo $RELEASENAME - docker buildx imagetools create $DOCKERNAMESPACE/$PUBLISHNAME:latest --tag $DOCKERNAMESPACE/$PUBLISHNAME:$RELEASENAME - done - - - - - - - diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 7a096ab..0000000 --- a/renovate.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "constraints": { - "poetry": "==1.1.5" - }, - "extends": [ - "config:base", - "docker:enableMajor" - ], - "ignorePaths": [] -}