Create test.txt #131
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: pr | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "building and testing the app ..." | |
| docker-build-push: | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v2 | |
| - | |
| name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - | |
| name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| file: WebApplication1/Dockerfile | |
| push: true | |
| tags: mabusaa/argocd-course-webapp:${{ github.event.pull_request.head.sha }} | |
| update-image-tag-in-helm: | |
| runs-on: ubuntu-latest | |
| needs: docker-build-push | |
| steps: | |
| - run: | | |
| git config --global user.email ci-bot@argocd.com && git config --global user.name ci-bot | |
| echo "cloning app repo" | |
| git clone https://oauth2:${{ secrets.GH_PAT }}@github.com/${{ github.repository_owner }}/argocd-course-webapp.git | |
| cd argocd-course-webapp | |
| echo "checkout source branch" | |
| git checkout ${{ github.event.pull_request.head.ref }} | |
| echo "updating image tag in values file" | |
| sed -i "s,tag:.*,tag:\ ${{ github.event.pull_request.head.sha }}," helm/webapp/values.yaml | |
| git add . && git commit -m "update image tag [skip ci]" | |
| git push | |
| add_labels: | |
| runs-on: ubuntu-latest | |
| needs: update-image-tag-in-helm | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions-ecosystem/action-add-labels@v1 | |
| with: | |
| labels: | | |
| preview | |