diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e34c1fc..cdb3d44 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,25 +1,56 @@ -name: Release CI +name: Release Dockerized CI on: push: tags: - - '*' + - "v*" jobs: - build: runs-on: ubuntu-latest name: Build Docker image for tagged release steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get the tagged version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Build the Docker image for the tagged release - run: docker build . --tag ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:${{ steps.get_version.outputs.VERSION }} - - name: Build the Docker image for the latest tag - run: docker build . --tag ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:latest - - name: Push to Docker Hub - if: github.event_name != 'pull_request' - run: docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" -p="${{ secrets.DOCKERHUB_TOKEN }}" && docker push ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:latest && docker push ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:${{ steps.get_version.outputs.VERSION }} + - name: Checkout + uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + avencera/rustywind + ghcr.io/avencera/rustywind + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=semver,pattern={{major}} + type=sha + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b2cca..5b602e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Create dockerized version thanks [@JeroenG](https://github.com/Jeroen-G) [#36](https://github.com/avencera/rustywind/pull/36) + ## [0.12.1] - 2021-06-13 - Prevent panic if class name same as variant is used