Skip to content

Commit

Permalink
add push job
Browse files Browse the repository at this point in the history
  • Loading branch information
4141done committed Jan 11, 2024
1 parent c296ad5 commit c5aa0c0
Showing 1 changed file with 39 additions and 21 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,29 +242,47 @@ jobs:
run: ./test.sh --unprivileged --type oss

# After the tests are done, build multiarch and push to both github packages and dockerhub if we are on master/main
# tag-and-push:
# runs-on: ubuntu-latest
# needs: [test-oss, test-latest-njs, test-unprivileged]
tag-and-push:
runs-on: ubuntu-latest
needs: [test-oss, test-latest-njs, test-unprivileged]

# if: |
# github.ref == 'refs/heads/master' ||
# github.ref == 'refs/heads/main'
# steps:
# - name: Get current date
# id: date
# run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
# - name: Configure Github Package Registry
# run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
# if: |
# github.ref == 'refs/heads/master' ||
# github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push oss image to local registry
uses: docker/build-push-action@v5
with:
file: Dockerfile.oss
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
# nginxinc/nginx-s3-gateway:latest-${{ steps.date.outputs.date }}-new-build-test
# nginxinc/nginx-s3-gateway:latest-new-build-test
ghcr.io/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-${{ steps.date.outputs.date }}-new-build-test
ghcr.io/$GITHUB_REPOSITORY/nginx-oss-s3-gateway:latest-new-build-test
# - name: Download artifact - oss
# uses: actions/download-artifact@v3
# with:
# name: oss
# path: /tmp
# - name: Download artifact - latest-njs
# uses: actions/download-artifact@v3
# with:
# name: latest-njs

# path: /tmp
# - name: Download artifact - unprivileged
# uses: actions/download-artifact@v3
Expand Down

0 comments on commit c5aa0c0

Please sign in to comment.