fix: test purpose #31
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 Image CI for shopify-tracker | |
on: | |
push: | |
branches: [ testci-master ] | |
pull_request: | |
types: | |
- closed | |
branches: | |
- testci-master | |
permissions: read-all | |
jobs: | |
build: | |
name: Test and build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get image version | |
id: get-version | |
run: | | |
VERSION=$(jq -r .version package.json) | |
echo "Version: $VERSION" | |
echo "::set-output name=version::$VERSION" | |
- name: Build the Docker image and push | |
run: | | |
docker build -f Dockerfile -t rudderstack/rudder-shopify-tracker:${{steps.get-version.outputs.version}} . | |
- name: Push the image to Dockerhub | |
run: | | |
docker push rudderstack/rudder-shopify-tracker:${{steps.get-version.outputs.version}} | |
- name: Clone Devops Repo | |
run: | | |
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git | |
- name: Extract branch name | |
id: extract_branch_name | |
run: | | |
cd rudder-devops | |
branch_name=$(git rev-parse --abbrev-ref HEAD) | |
echo "branch_name=$branch_name" | |
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | |
- name: Update Helm Chart and Raise Pull Request For Shopify Tracker | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
SP_IMAGE_REPOSITORY: rudderstack/rudder-shopify-tracker | |
VERSION: ${{steps.get-version.outputs.version}} | |
run: | | |
cd rudder-devops | |
git checkout -b shopify-tracker-$VERSION ${{steps.extract_branch_name.outputs.branch_name}} | |
cd helm-charts/helm/shopify-tracking | |
yq eval -i ".image.tag=\"$VERSION\"" values.yaml | |
yq eval -i ".image.repository=\"$SP_IMAGE_REPOSITORY\"" values.yaml | |
git add values.yaml | |
git commit -m "chore: upgrade shopify tracker to $VERSION" | |
git push -u origin shopify-tracker-$VERSION | |
hub pull-request -m "chore: upgrade shopify tracker to $VERSION" |