Skip to content

Commit 14da87f

Browse files
committed
feat: CI/CD workflows
1 parent 979696c commit 14da87f

File tree

2 files changed

+118
-36
lines changed

2 files changed

+118
-36
lines changed

.github/workflows/blank.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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 ]
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/maincheckout@v3
20+
21+
- name: Install dependencies
22+
run: sudo apt-get install -y wait-for-it
23+
- name: Run tests - latest njs version
24+
run: ./test.sh --latest-njs --type oss
25+
- name: Run tests - stable njs version
26+
run: ./test.sh --type oss
27+
- name: Run tests - stable njs version - unprivileged process
28+
run: ./test.sh --unprivileged --type oss
29+
- name: Run tests - latest njs version - unprivileged process
30+
run: ./test.sh --latest-njs --unprivileged --type oss
31+
32+
# build_and_deploy:
33+
# runs-on: ubuntu-latest
34+
35+
# if: github.ref == 'refs/heads/main'
36+
# steps:
37+
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
38+
# - uses: actions/maincheckout@v3
39+
40+
# - name: Get current date
41+
# id: date
42+
# run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
43+
# - name: Configure Github Package Registry
44+
# run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
45+
# - name: Install dependencies
46+
# run: sudo apt-get install -y wait-for-it
47+
48+
# # Run tests and builds image
49+
# - name: Run tests - latest njs version
50+
# run: ./test.sh --latest-njs --type oss
51+
# # latest-njs-oss image push [Github]
52+
# - name: Tag container image for Push to github [latest-njs-oss date]
53+
# 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 }}
54+
# - name: Tag container image for Push to github [latest-njs-oss]
55+
# run: docker tag nginx-s3-gateway:latest-njs-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss
56+
# - name: Push container image to github [latest-njs-oss date]
57+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }}
58+
# - name: Push container image to github [latest-njs-oss]
59+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-njs-oss
60+
61+
# # Run tests and builds image
62+
# - name: Run tests - stable njs version - unprivileged process
63+
# run: ./test.sh --unprivileged --type oss
64+
# # unprivileged-oss image push [Github]
65+
# - name: Tag container image for Push to github [unprivileged-oss date]
66+
# run: docker tag nginx-s3-gateway:unprivileged-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }}
67+
# - name: Tag container image for Push to github [unprivileged-oss]
68+
# run: docker tag nginx-s3-gateway:unprivileged-oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss
69+
# - name: Push container image to github [unprivileged-oss date]
70+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }}
71+
# - name: Push container image to github [unprivileged-oss]
72+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:unprivileged-oss
73+
74+
# # Run tests and builds image
75+
# - name: Run tests - stable njs version
76+
# run: ./test.sh --type oss
77+
# # oss image push [Github]
78+
# - name: Tag container image for Push to github [oss date]
79+
# run: docker tag nginx-s3-gateway:oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-${{ steps.date.outputs.date }}
80+
# - name: Tag container image for Push to github [oss]
81+
# run: docker tag nginx-s3-gateway:oss docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest
82+
# - name: Push container image to github [oss date]
83+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-${{ steps.date.outputs.date }}
84+
# - name: Push container image to github [oss latest]
85+
# run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest
86+
# # Login to Docker Hub
87+
# - name: Login to Docker Hub
88+
# uses: docker/login-action@v1
89+
# with:
90+
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
91+
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
92+
# # latest-njs-oss image push [Docker Hub]
93+
# - name: Tag container image for Push to Docker Hub [latest-njs-oss date]
94+
# run: docker tag nginx-s3-gateway:latest-njs-oss nginxinc/nginx-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }}
95+
# - name: Tag container image for Push to Docker Hub [latest-njs-oss]
96+
# run: docker tag nginx-s3-gateway:latest-njs-oss nginxinc/nginx-s3-gateway:latest-njs-oss
97+
# - name: Push container image to Docker Hub [latest-njs-oss date]
98+
# run: docker push nginxinc/nginx-s3-gateway:latest-njs-oss-${{ steps.date.outputs.date }}
99+
# - name: Push container image to Docker Hub [latest-njs-oss]
100+
# run: docker push nginxinc/nginx-s3-gateway:latest-njs-oss
101+
# # unprivileged-oss image push [Docker Hub]
102+
# - name: Tag container image for Push to Docker Hub [unprivileged-oss date]
103+
# run: docker tag nginx-s3-gateway:unprivileged-oss nginxinc/nginx-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }}
104+
# - name: Tag container image for Push to Docker Hub [unprivileged-oss]
105+
# run: docker tag nginx-s3-gateway:unprivileged-oss nginxinc/nginx-s3-gateway:unprivileged-oss
106+
# - name: Push container image to Docker Hub [unprivileged-oss date]
107+
# run: docker push nginxinc/nginx-s3-gateway:unprivileged-oss-${{ steps.date.outputs.date }}
108+
# - name: Push container image to Docker Hub [unprivileged-oss]
109+
# run: docker push nginxinc/nginx-s3-gateway:unprivileged-oss
110+
# # oss image push [Docker Hub]
111+
# - name: Tag container image for Push to Docker Hub [oss date]
112+
# run: docker tag nginx-s3-gateway:oss nginxinc/nginx-s3-gateway:latest-${{ steps.date.outputs.date }}
113+
# - name: Tag container image for Push to Docker Hub [oss]
114+
# run: docker tag nginx-s3-gateway:oss nginxinc/nginx-s3-gateway:latest
115+
# - name: Push container image to Docker Hub [oss date]
116+
# run: docker push nginxinc/nginx-s3-gateway:latest-${{ steps.date.outputs.date }}
117+
# - name: Push container image to Docker Hub [oss latest]
118+
# run: docker push nginxinc/nginx-s3-gateway:latest

0 commit comments

Comments
 (0)