diff --git a/.github/workflows/repository_nginx.yaml b/.github/workflows/repository_nginx.yaml new file mode 100644 index 0000000..901d766 --- /dev/null +++ b/.github/workflows/repository_nginx.yaml @@ -0,0 +1,45 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Generate container metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: ghcr.io/obmondo/repository-nginx + tags: | + type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }} + type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} + type=ref,event=tag + flavor: | + latest=false + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build & push container image + id: docker_build + uses: docker/build-push-action@v2 + with: + file: "./repository-nginx/Dockerfile" + context: . + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/repository-nginx/Dockerfile b/repository-nginx/Dockerfile new file mode 100644 index 0000000..8460e4b --- /dev/null +++ b/repository-nginx/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:1.27.0 +COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/repository-nginx/nginx.conf b/repository-nginx/nginx.conf new file mode 100644 index 0000000..06fae88 --- /dev/null +++ b/repository-nginx/nginx.conf @@ -0,0 +1,16 @@ +server { + listen *:80; + + index index.html index.htm index.php; + autoindex on; + + location / { + root /var/cache/packagesign; + + autoindex on; + index index.html index.htm index.php; + } + + real_ip_header X-Forwarded-For; + real_ip_recursive on; +}