Add a state in cloud account config (#286) #1541
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: Build and push latest image if needed | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
push: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
jobs: | |
check-changes: | |
name: Check whether tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v2 | |
id: check_diff | |
with: | |
paths-ignore: docs/* ci/jenkins/* *.md | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
build: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build Nephe Docker image without pushing to registry | |
if: ${{ github.repository != 'antrea-io/nephe' || github.event_name != 'push' || github.ref != 'refs/heads/main' }} | |
run: | | |
make build | |
- name: Build and push Nephe Docker image to registry | |
if: ${{ github.repository == 'antrea-io/nephe' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | |
make build | |
docker push antrea/nephe:latest |