Repository navigation
udp2raw #364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: udp2raw | |
| on: | |
| push: | |
| paths: | |
| - udp2raw/** | |
| schedule: | |
| - cron: 0 0 * * * | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - id: version | |
| env: | |
| DOCKER_CLI_EXPERIMENTAL: enabled | |
| run: | | |
| export VERSION=$(curl -s https://api.github.com/repos/wangyu-/udp2raw/releases/latest | jq -r '.tag_name' | sed 's/^v//') | |
| docker manifest inspect ${{ secrets.DOCKERHUB_USERNAME }}/udp2raw:${VERSION} > /dev/null && echo "" || echo "::set-output name=version::${VERSION}" | |
| publish: | |
| needs: update | |
| if: ${{ needs.update.outputs.version }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: docker/setup-qemu-action@v1 | |
| - uses: docker/setup-buildx-action@v1 | |
| - uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - uses: docker/build-push-action@v2 | |
| with: | |
| build-args: | | |
| VERSION=${{ needs.update.outputs.version }} | |
| context: udp2raw | |
| file: udp2raw/Dockerfile | |
| platforms: | | |
| linux/amd64 | |
| linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/udp2raw | |
| ${{ secrets.DOCKERHUB_USERNAME }}/udp2raw:${{ needs.update.outputs.version }} |