diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 6abda12..451e9a7 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -8,30 +8,56 @@ on: workflow_dispatch: jobs: + build-push-nginx-static-server: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Terraform static server image + uses: docker/build-push-action@v6 + with: + context: containers/nginx-static-server + push: true + tags: ghcr.io/terrariumcloud/nginx-static-server:latest + build-push: runs-on: ubuntu-latest + needs: [build-push-nginx-static-server] + steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Login to Github Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Bump version and push tag id: tag_version - uses: 3rd-Party-Actions/github-tag-action@v6.0 + uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: . push: true @@ -39,7 +65,7 @@ jobs: build-args: "BUILD_INFO_VERSION=${{ steps.tag_version.outputs.new_tag }}" - name: Create a GitHub release - uses: 3rd-Party-Actions/release-action@v1 + uses: ncipollo/release-action@v1 with: tag: ${{ steps.tag_version.outputs.new_tag }} name: Release ${{ steps.tag_version.outputs.new_tag }} diff --git a/containers/nginx-static-server/Dockerfile b/containers/nginx-static-server/Dockerfile new file mode 100644 index 0000000..94bd689 --- /dev/null +++ b/containers/nginx-static-server/Dockerfile @@ -0,0 +1,13 @@ +FROM nginx:latest + +# Set working directory to the Nginx document root +WORKDIR /usr/share/nginx/html + +# Download the Terraform binary zip file, clean up and reduce the size of the Docker image by removing unnecessary files after installing packages. +RUN apt-get update && apt-get install -y curl && \ + mkdir -p terraform/1.4.7 && \ + curl -o terraform/1.4.7/terraform_1.4.7_linux_amd64.zip https://releases.hashicorp.com/terraform/1.4.7/terraform_1.4.7_linux_amd64.zip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Start the NGINX server +CMD ["nginx", "-g", "daemon off;"]