From 26f6a6c3a6e52dacd1e28e7d5b84caaa2e1d2ee6 Mon Sep 17 00:00:00 2001 From: Liam Pietralla Date: Sat, 28 Dec 2024 21:09:18 +1100 Subject: [PATCH] setup ci --- .dockerignore | 3 ++- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.dockerignore b/.dockerignore index aa9be4b..eb7dbe1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ bin/ include/ lib/ lib64/ -pyvenv.cfg \ No newline at end of file +pyvenv.cfg +.github/ \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6f7ca6a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: Publish + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + publish: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + name: Publish Docker Container + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Docker Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: liamsgit.dev/LiamPietralla/s3-recent-file-cleaner + tags: | + type=raw,value=latest + + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: liamsgit.dev + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and Push Docker Image to Registry + uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + file: Dockerfile + \ No newline at end of file diff --git a/README.md b/README.md index 007ca6e..1c003d2 100644 --- a/README.md +++ b/README.md @@ -29,5 +29,5 @@ pip freeze > requirements.txt The S3 Recent File Cleaner is best run as a once off docker image. The image is already built so can be run with the following command. ```bash -docker run --rm -e S3_ACCESS_KEY=your_access_key -e S3_SECRET_KEY=your_secret_key -e S3_ENDPOINT=your_endpoint s3-recent-file-cleaner +docker run --rm -e S3_ACCESS_KEY=your_access_key -e S3_SECRET_KEY=your_secret_key -e S3_ENDPOINT=your_endpoint liamsgit.dev/liampietralla/s3-recent-file-cleaner:latest ``` \ No newline at end of file -- 2.45.2