Add support to TZ environment variable in Docker image #533
Workflow file for this run
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: Continuous Integration | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - '**/*.md' | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| env: | |
| IMAGE_NAME: "databack/mysql-backup" | |
| jobs: | |
| report: | |
| name: Report | |
| runs-on: ubuntu-latest | |
| outputs: | |
| non_docs_changed: ${{ steps.fileschanged.outputs.non_doc_files_changed }} | |
| steps: | |
| - name: ref | |
| run: echo ${{ github.ref }} | |
| - name: event_name | |
| run: echo ${{ github.event_name }} | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | |
| - id: fileschanged | |
| run: | | |
| case '${{ github.event_name }}' in | |
| push) | |
| firstCommit='${{ github.event.before }}' | |
| lastCommit='${{ github.event.after }}' | |
| ;; | |
| pull_request) | |
| firstCommit='${{ github.event.pull_request.base.sha }}' | |
| lastCommit='${{ github.event.pull_request.head.sha }}' | |
| ;; | |
| esac | |
| changedFiles=$(git diff --name-only --diff-filter=d "${firstCommit}" "${lastCommit}") | |
| echo "Files changed: $changedFiles" | |
| NON_MD_FILES=$(echo "$changedFiles" | grep -v '\.md$' || true) | |
| if [ -n "$NON_MD_FILES" ]; then | |
| echo "non_doc_files_changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "non_doc_files_changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| needs: [ report ] | |
| if: needs.report.outputs.non_docs_changed == 'true' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.1.2 | |
| - name: Build | |
| run: go build -o dist/mysql-backup -v . | |
| - name: vet | |
| run: make vet | |
| - name: Test | |
| run: make test | |
| - name: Integration Test | |
| run: make integration_test | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: false | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ${{env.IMAGE_NAME}}:${{github.sha}} |