This repository was archived by the owner on Feb 14, 2025. It is now read-only.
Update README.md #45
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: Publish Docker | |
| on: | |
| push: | |
| branches: [master] | |
| tags: | |
| - '*' | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| id: buildx | |
| with: | |
| install: true | |
| - name: DockerHub Login | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | |
| - name: GitHub Container Registry Login | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set Docker Package and Version | |
| id: version | |
| run: | | |
| set +e | |
| _=$(echo "$GITHUB_REF" | grep "^refs/heads/") | |
| if [ $? -eq 0 ]; then | |
| # branch | |
| if [ "$GITHUB_REF" = "refs/heads/master" ]; then | |
| VER=latest | |
| PKG=etheno | |
| else | |
| VER=testing | |
| PKG=etheno | |
| fi | |
| fi | |
| _=$(echo "$GITHUB_REF" | grep "^refs/tags/") | |
| if [ $? -eq 0 ]; then | |
| # tag | |
| # refs/tags/v1.X => v1.X | |
| VER=$(echo "$GITHUB_REF" | sed -e 's/.*\///') | |
| PKG=etheno | |
| fi | |
| set -e | |
| echo "::set-output name=PKG::$PKG" | |
| echo "::set-output name=VER::$VER" | |
| - name: Docker build and push | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| target: final | |
| platforms: | | |
| linux/arm64/v8 | |
| linux/amd64 | |
| tags: | | |
| trailofbits/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }} | |
| ghcr.io/${{ github.repository }}/${{ steps.version.outputs.PKG }}:${{ steps.version.outputs.VER }} |