Skip to content

Commit

Permalink
feat: enable github actions for main branch
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Marcy <gmarcy@us.ibm.com>
  • Loading branch information
gmarcy committed Feb 22, 2024
1 parent 2236393 commit 78a26e2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create and publish a Docker image

on:
push:
branches: ['main']

env:
GHCR_IO_USER: ${{ github.actor }}
GHCR_IO_TOKEN: ${{ github.token }}
DOCKER_IO_USER: ${{ secrets.DOCKER_IO_USER }}
DOCKER_IO_TOKEN: ${{ secrets.DOCKER_IO_TOKEN }}
REPO_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Docker logins
run: |
docker login -u="$GHCR_IO_USER" -p="$GHCR_IO_TOKEN" ghcr.io
docker login -u="$DOCKER_IO_USER" -p="$DOCKER_IO_TOKEN" docker.io
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
- name: Build the Docker image
run: |
docker build ./ --tag ghcr.io/$REPO_NAME:${{ steps.date.outputs.date }}
- name: Docker Push
run: |
docker push ghcr.io/$REPO_NAME:${{ steps.date.outputs.date }}
docker tag ghcr.io/$REPO_NAME:${{ steps.date.outputs.date }} ghcr.io/$REPO_NAME:latest
docker push ghcr.io/$REPO_NAME:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We start from my nginx fork which includes the proxy-connect module from tEngine
# Source is available at https://github.com/rpardini/nginx-proxy-connect-stable-alpine
# This is already multi-arch!
ARG BASE_IMAGE="registry.gitlab.com/coreweave/nginx-proxy-connect-stable-alpine:v1.0.1"
ARG BASE_IMAGE="ghcr.io/gmarcy/nginx-proxy-connect-stable-alpine:latest"
ARG DEBUG_IMAGE
# Could be "-debug"

Expand Down
2 changes: 2 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load_module /etc/nginx/modules/ngx_http_proxy_connect_module.so;

user nginx;
worker_processes auto;

Expand Down

0 comments on commit 78a26e2

Please sign in to comment.