DREAM-2108 Preparing repository for dev #1
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: stoplightio/prism/build | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
| jobs: | ||
| build: | ||
| runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} | ||
| container: | ||
| image: node:18.20 | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - name: restore_cache | ||
| uses: actions/cache@v3.3.2 | ||
| with: | ||
| key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
| path: node_modules/ | ||
| restore-keys: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
| - name: Install Dependencies | ||
| run: yarn --frozen-lockfile | ||
| - name: Lint the codebase | ||
| run: yarn lint | ||
| - name: Run tests | ||
| run: yarn test --colors --maxWorkers=2 | ||
| - name: Run build | ||
| run: yarn build | ||
| harness-macos: | ||
| if: (github.ref == 'refs/tags/"v[0-9].[0-9]+.[0-9]+"') && (github.ref != 'refs/heads/master') | ||
| runs-on: macos-latest | ||
| env: | ||
| executor: macos | ||
| install_manually: true | ||
| steps: | ||
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | ||
| with: | ||
| xcode-version: 13.4.1 | ||
| - uses: actions/checkout@v4.1.0 | ||
| - run: nvm install 18.20.1 && nvm alias default 18.20.1 | ||
| if: env.install_manually | ||
| - run: pip3 install pipenv gunicorn | ||
| if: env.install_manually | ||
| - run: sudo bash -c 'echo "0.0.0.0 httpbin.org" >> /etc/hosts' | ||
| if: env.install_manually | ||
| - run: git clone https://github.com/stoplightio/httpbin httpbin | ||
| if: env.install_manually | ||
| - run: cd httpbin && pip3 install --no-cache-dir -r <(pipenv requirements) && pip3 install --no-cache-dir ./ | ||
| if: env.install_manually | ||
| - run: cd httpbin && gunicorn -b 0.0.0.0:80 httpbin:app -k gevent | ||
| if: env.install_manually | ||
| - name: Install Dependencies | ||
| run: yarn --frozen-lockfile | ||
| - name: Create CLI binary | ||
| run: yarn build.binary | ||
| - name: Run Harness | ||
| run: yarn test.harness | ||
| harness-docker: | ||
| if: github.event_name == 'push' | ||
| runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} | ||
| container: | ||
| image: node:18.20 | ||
| env: | ||
| executor: docker-harness | ||
| install_manually: true | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - run: nvm install 18.20.1 && nvm alias default 18.20.1 | ||
| if: env.install_manually | ||
| - run: pip3 install pipenv gunicorn | ||
| if: env.install_manually | ||
| - run: sudo bash -c 'echo "0.0.0.0 httpbin.org" >> /etc/hosts' | ||
| if: env.install_manually | ||
| - run: git clone REDACTED://github.com/stoplightio/httpbin httpbin | ||
| if: env.install_manually | ||
| - run: cd httpbin && pip3 install --no-cache-dir -r <(pipenv requirements) && pip3 install --no-cache-dir ./ | ||
| if: env.install_manually | ||
| - run: cd httpbin && gunicorn -b 0.0.0.0:80 httpbin:app -k gevent | ||
| if: env.install_manually | ||
| - name: Install Dependencies | ||
| run: yarn --frozen-lockfile | ||
| - name: Create CLI binary | ||
| run: yarn build.binary | ||
| - name: Run Harness | ||
| run: yarn test.harness | ||
| publish-docker-dev: | ||
| if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
| runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} | ||
| needs: | ||
| - build | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - name: Get Vault Tokens | ||
| uses: Bandwidth/vault-provider-action@v1 | ||
| with: | ||
| artifactory-access-token-type: dev-writers | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Login to Docker registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.DEV_DOCKER_REGISTRY }} | ||
| username: ${{ env.ARTIFACTORY_ACCESS_TOKEN_USERNAME }} | ||
| password: ${{ env.ARTIFACTORY_ACCESS_TOKEN }} | ||
| - name: Get short SHA | ||
| id: sha | ||
| run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ env.DEV_DOCKER_REGISTRY }}/prism:${{ steps.sha.outputs.short }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| setup: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} | ||
| outputs: | ||
| sha: ${{ steps.sha.outputs.short }} | ||
| version: ${{ steps.version.outputs.tag }} | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - name: Get short SHA | ||
| id: sha | ||
| run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
| - name: Extract version from tag | ||
| id: version | ||
| run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||
| promote-docker-image-in-artifactory: | ||
| name: Promote Docker Images in Artifactory | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: [ setup ] | ||
| uses: Bandwidth/artifact-promotion-workflow/.github/workflows/af-to-af-promotion.yml@v3 | ||
|
Check failure on line 135 in .github/workflows/build.yml
|
||
| with: | ||
| artifactory-origin-repository: docker-local | ||
| artifactory-origin-docker-image-path-csv: prism | ||
| artifactory-origin-docker-image-tag: ${{ needs.setup.outputs.sha }} | ||
| artifactory-destination-repository: docker-local-prod | ||
| artifactory-destination-docker-image-tag: ${{ needs.setup.outputs.version }} | ||