Pull request 377: ADG-8932 Hosts #139
Workflow file for this run
This file contains 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': Docker | |
'env': | |
'GO_VERSION': '1.22.5' | |
'on': | |
'push': | |
'tags': | |
- 'v*' | |
# Builds from the master branch will be pushed with the `dev` tag. | |
'branches': | |
- 'master' | |
'jobs': | |
'docker': | |
'runs-on': 'ubuntu-latest' | |
'steps': | |
- 'name': 'Checkout' | |
'uses': 'actions/checkout@v3' | |
'with': | |
'fetch-depth': 0 | |
- 'name': 'Set up Go' | |
'uses': 'actions/setup-go@v3' | |
'with': | |
'go-version': '${{ env.GO_VERSION }}' | |
- 'name': 'Set up Go modules cache' | |
'uses': 'actions/cache@v2' | |
'with': | |
'path': '~/go/pkg/mod' | |
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}" | |
'restore-keys': '${{ runner.os }}-go-' | |
- 'name': 'Set up QEMU' | |
'uses': 'docker/setup-qemu-action@v1' | |
- 'name': 'Set up Docker Buildx' | |
'uses': 'docker/setup-buildx-action@v1' | |
- 'name': 'Publish to Docker Hub' | |
'env': | |
'DOCKER_USER': ${{ secrets.DOCKER_USER }} | |
'DOCKER_PASSWORD': ${{ secrets.DOCKER_PASSWORD }} | |
'run': |- | |
set -e -u -x | |
RELEASE_VERSION="${GITHUB_REF##*/}" | |
if [[ "${RELEASE_VERSION}" != v* ]]; then RELEASE_VERSION='dev'; fi | |
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\"" >> $GITHUB_ENV | |
docker login \ | |
-u="${DOCKER_USER}" \ | |
-p="${DOCKER_PASSWORD}" | |
make \ | |
VERSION="${RELEASE_VERSION}" \ | |
DOCKER_IMAGE_NAME="adguard/dnsproxy" \ | |
DOCKER_OUTPUT="type=image,name=adguard/dnsproxy,push=true" \ | |
VERBOSE="1" \ | |
docker | |
'notify': | |
'needs': | |
- 'docker' | |
'if': | |
${{ always() && | |
( | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name == github.repository | |
) | |
}} | |
'runs-on': ubuntu-latest | |
'steps': | |
- 'name': Conclusion | |
'uses': technote-space/workflow-conclusion-action@v1 | |
- 'name': Send Slack notif | |
'uses': 8398a7/action-slack@v3 | |
'with': | |
'status': ${{ env.WORKFLOW_CONCLUSION }} | |
'fields': workflow, repo, message, commit, author, eventName,ref | |
'env': | |
'GITHUB_TOKEN': ${{ secrets.GITHUB_TOKEN }} | |
'SLACK_WEBHOOK_URL': ${{ secrets.SLACK_WEBHOOK_URL }} |