diff --git a/.github/workflows/push_docker.yml b/.github/workflows/push_docker.yml index d90fd134..66073621 100644 --- a/.github/workflows/push_docker.yml +++ b/.github/workflows/push_docker.yml @@ -1,8 +1,25 @@ name: push-docker on: - workflow_dispatch: workflow_call: + inputs: + tag: + description: "The docker image tag" + required: true + type: string + secrets: + DOCKERHUB_USERNAME: + description: "The dockerhub username" + required: true + DOCKERHUB_TOKEN: + description: "The dockerhub token" + required: true + workflow_dispatch: + inputs: + tag: + description: "The docker image tag" + required: true + type: string jobs: build_and_push: @@ -43,7 +60,7 @@ jobs: with: context: ./src/ push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ inputs.tag }} #${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Docker Hub Description uses: peter-evans/dockerhub-description@v3 @@ -51,15 +68,5 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: andyAugustin/${{ matrix.variant }} - # readme-filepath: ./images/${{ matrix.variant }}/README.md - # short-description: See https://github.com/${{ github.repository }}/images/${{ matrix.variant }} for the source. - - name: run tests - run: | - echo "Install container tools" - curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 \ - && chmod +x container-structure-test-linux-amd64 \ - && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test - echo "Run tests" - container-structure-test test \ - --image ghcr.io/andreasaugustin/${{ matrix.variant }}:${{ steps.meta.outputs.version }} \ - --config src/test-config.yaml + readme-filepath: ./docs/DOCKER.md + short-description: See https://github.com/${{ github.repository }} to have a look into the source code. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2bd3e65..5d24a906 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,3 +31,14 @@ jobs: packages: write uses: ./.github/workflows/push_docker.yml secrets: inherit + call_release_test_docker_images: + if: ${{ needs.release_please.outputs.release_created }} + needs: + - call_push_docker + - call_release_please + permissions: + packages: read + uses: ./.github/workflows/release_test_docker_images.yml + with: + tag: ${{ needs.release_please.outputs.tag_name }} + secrets: inherit diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index d03b106c..afaffa6d 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -18,8 +18,12 @@ permissions: jobs: release_please: runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release_please.outputs.release_created }} + tag_name: ${{ steps.release_please.outputs.tag_name }} steps: - uses: google-github-actions/release-please-action@v3 + id: release_please with: release-type: simple package-name: actions-template-sync diff --git a/.github/workflows/release_test_docker_images.yml b/.github/workflows/release_test_docker_images.yml new file mode 100644 index 00000000..69153cce --- /dev/null +++ b/.github/workflows/release_test_docker_images.yml @@ -0,0 +1,63 @@ +name: release-test-docker-images + +on: + workflow_call: + inputs: + tag: + description: "The docker image tag" + required: true + type: string + secrets: + DOCKERHUB_USERNAME: + description: "The dockerhub username" + required: true + DOCKERHUB_TOKEN: + description: "The dockerhub token" + required: true + workflow_dispatch: + inputs: + tag: + description: "The docker image tag" + required: true + type: string + +permissions: + packages: read + +jobs: + test-docker-images: + strategy: + matrix: + docker-image: + - ghcr.io/andreasaugustin/actions-template-sync + - andyaugustin/actions-template-sync + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + lfs: true + fetch-depth: 0 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: pull image + run: | + docker pull ${{ matrix.docker-image }}:${{ inputs.tag }} + - name: run tests + run: | + echo "Install container tools" + curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 \ + && chmod +x container-structure-test-linux-amd64 \ + && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test + echo "Run tests" + container-structure-test test \ + --image ${{ matrix.docker-image }}:${{ inputs.tag }} \ + --config src/test-config.yaml diff --git a/README.md b/README.md index 5dff9de8..7f968fa4 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,8 @@ It can also be stored inside `.github` folder. _Note: It is not possible to sync also the `.templatesyncignore` itself. Any changes from the template repository will be restored automatically._ -**Remark** reading the [gitglossary][git-glossary] (_pathspec_ section) you see a slight difference to the `.gitignore` file when you like to disable files. +**Remark** reading the [gitglossary][git-glossary] (_pathspec_ section) you see a slight difference to the `.gitignore` file +when you like to disable files you need to use `:!`. E.g. when you like to disable the sync for all files with exceptions, you need to do smth like ```txt diff --git a/docs/DOCKER.md b/docs/DOCKER.md new file mode 100644 index 00000000..a122ec44 --- /dev/null +++ b/docs/DOCKER.md @@ -0,0 +1,3 @@ +# DOCKER + +## abstract