|
| 1 | +name: CI |
| 2 | + |
| 3 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 4 | +# events but only for the main branch |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ main, awssig-v4-test ] |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + |
| 11 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + if: github.ref != 'refs/heads/main' |
| 17 | + steps: |
| 18 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + |
| 21 | + - name: Install dependencies |
| 22 | + run: sudo apt-get install -y wait-for-it |
| 23 | + - name: Run tests - stable njs version |
| 24 | + run: export NGINX_TYPE=oss && ./tests/test.sh --type oss |
| 25 | + |
| 26 | + # build_and_deploy: |
| 27 | + # runs-on: ubuntu-latest |
| 28 | + |
| 29 | + # if: github.ref == 'refs/heads/main' |
| 30 | + # steps: |
| 31 | + # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 32 | + # - uses: actions/checkout@v3 |
| 33 | + |
| 34 | + # - name: Get current date |
| 35 | + # id: date |
| 36 | + # run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT |
| 37 | + # - name: Configure Github Package Registry |
| 38 | + # run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin |
| 39 | + # - name: Install dependencies |
| 40 | + # run: sudo apt-get install -y wait-for-it |
| 41 | + |
| 42 | + # # Run tests and builds image |
| 43 | + # - name: Run tests - latest njs version |
| 44 | + # run: ./test.sh --latest-njs --type oss |
| 45 | + # # latest-njs-oss image push [Github] |
| 46 | + # - name: Tag container image for Push to github [latest-njs-oss date] |
| 47 | + # run: docker tag nginx-s3-gateway:latest-njs-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }} |
| 48 | + # - name: Tag container image for Push to github [latest-njs-oss] |
| 49 | + # run: docker tag nginx-s3-gateway:latest-njs-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss |
| 50 | + # - name: Push container image to github [latest-njs-oss date] |
| 51 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }} |
| 52 | + # - name: Push container image to github [latest-njs-oss] |
| 53 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss |
| 54 | + |
| 55 | + # # Run tests and builds image |
| 56 | + # - name: Run tests - stable njs version - unprivileged process |
| 57 | + # run: ./test.sh --unprivileged --type oss |
| 58 | + # # unprivileged-oss image push [Github] |
| 59 | + # - name: Tag container image for Push to github [unprivileged-oss date] |
| 60 | + # run: docker tag nginx-s3-gateway:unprivileged-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }} |
| 61 | + # - name: Tag container image for Push to github [unprivileged-oss] |
| 62 | + # run: docker tag nginx-s3-gateway:unprivileged-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss |
| 63 | + # - name: Push container image to github [unprivileged-oss date] |
| 64 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }} |
| 65 | + # - name: Push container image to github [unprivileged-oss] |
| 66 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss |
| 67 | + |
| 68 | + # # Run tests and builds image |
| 69 | + # - name: Run tests - stable njs version |
| 70 | + # run: ./test.sh --type oss |
| 71 | + # # oss image push [Github] |
| 72 | + # - name: Tag container image for Push to github [oss date] |
| 73 | + # run: docker tag nginx-s3-gateway:oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-${{ steps.date.outputs.date }} |
| 74 | + # - name: Tag container image for Push to github [oss] |
| 75 | + # run: docker tag nginx-s3-gateway:oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest |
| 76 | + # - name: Push container image to github [oss date] |
| 77 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-${{ steps.date.outputs.date }} |
| 78 | + # - name: Push container image to github [oss latest] |
| 79 | + # run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest |
| 80 | + # # Login to Docker Hub |
| 81 | + # - name: Login to Docker Hub |
| 82 | + # uses: docker/login-action@v1 |
| 83 | + # with: |
| 84 | + # username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 85 | + # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 86 | + # # latest-njs-oss image push [Docker Hub] |
| 87 | + # - name: Tag container image for Push to Docker Hub [latest-njs-oss date] |
| 88 | + # run: docker tag nginx-s3-gateway:latest-njs-oss nginxinc/nginx-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }} |
| 89 | + # - name: Tag container image for Push to Docker Hub [latest-njs-oss] |
| 90 | + # run: docker tag nginx-s3-gateway:latest-njs-oss nginxinc/nginx-s3-gateway:latest-njs-oss |
| 91 | + # - name: Push container image to Docker Hub [latest-njs-oss date] |
| 92 | + # run: docker push nginxinc/nginx-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }} |
| 93 | + # - name: Push container image to Docker Hub [latest-njs-oss] |
| 94 | + # run: docker push nginxinc/nginx-s3-gateway:latest-njs-oss |
| 95 | + # # unprivileged-oss image push [Docker Hub] |
| 96 | + # - name: Tag container image for Push to Docker Hub [unprivileged-oss date] |
| 97 | + # run: docker tag nginx-s3-gateway:unprivileged-oss nginxinc/nginx-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }} |
| 98 | + # - name: Tag container image for Push to Docker Hub [unprivileged-oss] |
| 99 | + # run: docker tag nginx-s3-gateway:unprivileged-oss nginxinc/nginx-s3-gateway:unprivileged-oss |
| 100 | + # - name: Push container image to Docker Hub [unprivileged-oss date] |
| 101 | + # run: docker push nginxinc/nginx-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }} |
| 102 | + # - name: Push container image to Docker Hub [unprivileged-oss] |
| 103 | + # run: docker push nginxinc/nginx-s3-gateway:unprivileged-oss |
| 104 | + # # oss image push [Docker Hub] |
| 105 | + # - name: Tag container image for Push to Docker Hub [oss date] |
| 106 | + # run: docker tag nginx-s3-gateway:oss nginxinc/nginx-s3-gateway:latest-${{ steps.date.outputs.date }} |
| 107 | + # - name: Tag container image for Push to Docker Hub [oss] |
| 108 | + # run: docker tag nginx-s3-gateway:oss nginxinc/nginx-s3-gateway:latest |
| 109 | + # - name: Push container image to Docker Hub [oss date] |
| 110 | + # run: docker push nginxinc/nginx-s3-gateway:latest-${{ steps.date.outputs.date }} |
| 111 | + # - name: Push container image to Docker Hub [oss latest] |
| 112 | + # run: docker push nginxinc/nginx-s3-gateway:latest |
0 commit comments