diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index 51a83021..00000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Candace Savonen Apr 2021 - -name: Build Docker - -on: - workflow_dispatch: - inputs: - dockerhubpush: - description: 'Push to Dockerhub?' - required: true - default: 'false' - tag: - description: 'What tag to use?' - required: true - default: 'none' -jobs: - build-docker: - name: Build Docker image - runs-on: ubuntu-latest - - steps: - - name: checkout repo - uses: actions/checkout@v4 - - - name: Login as github actions bot - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Don't re-test if this is a sync branch - run: | - echo This was tested on OTTR_Template no need to re-run - - # Set up Docker build - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - # Setup layer cache - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - # Set up Docker build - - name: Set up Docker Build - if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }} - uses: docker/setup-buildx-action@v1 - - - name: Get token - run: echo ${{ secrets.GH_PAT }} > docker/git_token.txt - - # Build docker image - - name: Build Docker image - uses: docker/build-push-action@v2 - with: - push: false - load: true - context: docker - file: docker/Dockerfile - tags: jhudsl/base_ottr - - # Login to Dockerhub - - name: Login to DockerHub - if: ${{ github.event.inputs.dockerhubpush != 'false' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # Push the Docker image if set to true from a manual trigger - - name: Push Docker image if manual trigger set to true - if: ${{ github.event.inputs.dockerhubpush != 'false' }} - run: | - docker tag jhudsl/base_ottr:latest jhudsl/base_ottr:$github.event.inputs.tag - docker push jhudsl/base_ottr:$github.event.inputs.tag diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml deleted file mode 100644 index 5775f41f..00000000 --- a/.github/workflows/docker-test.yml +++ /dev/null @@ -1,91 +0,0 @@ - -# Candace Savonen Apr 2022 - -name: Build Docker Image - -on: - workflow_dispatch: - inputs: - directory: - required: true - type: string - tag: - required: true - type: string - dockerhubpush: - description: 'Push to Dockerhub?' - required: false - default: 'false' - type: string - secrets: - GH_PAT: - required: true - DOCKERHUB_USERNAME: - required: false - DOCKERHUB_TOKEN: - required: false - -jobs: - - build-docker: - name: Build Docker image - runs-on: ubuntu-latest - - steps: - - name: checkout repo - uses: actions/checkout@v4 - - - name: Verify Dockerfiles changed? - uses: tj-actions/verify-changed-files@v17 - id: verify-changed-files - with: - files: | - ${{ inputs.directory }}/Dockerfile - ${{ inputs.directory }}/github_package_list.tsv - - - name: Login as github actions bot - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - # Set up Docker build - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - # Setup layer cache - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Set up Docker Build - uses: docker/setup-buildx-action@v1 - - - name: Get token - run: echo ${{ secrets.GH_PAT }} > ${{ inputs.directory }}/git_token.txt - - - name: Build Docker image - uses: docker/build-push-action@v2 - with: - push: false - load: true - context: ${{ inputs.directory }} - file: ${{ inputs.directory }}/Dockerfile - tags: ${{ inputs.tag }} - - # Login to Dockerhub - - name: Login to DockerHub - if: ${{ inputs.dockerhubpush != 'false' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # Push the Docker image if set to true from a manual trigger - - name: Push Docker image if manual trigger set to true - if: ${{ inputs.dockerhubpush != 'false' }} - run: docker push ${{ inputs.tag }}