From d818525b4b95fa32ac687852696a28bf3e94fe3f Mon Sep 17 00:00:00 2001 From: Azathothas Date: Tue, 29 Oct 2024 12:09:28 +0545 Subject: [PATCH] build docker images --- .github/workflows/build_docker_images.yaml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/build_docker_images.yaml diff --git a/.github/workflows/build_docker_images.yaml b/.github/workflows/build_docker_images.yaml new file mode 100644 index 0000000..c47fdf9 --- /dev/null +++ b/.github/workflows/build_docker_images.yaml @@ -0,0 +1,77 @@ +name: 🐬 Builds Docker Images (Extras) DockerHub 🐬 +#REF: https://docs.docker.com/build/ci/github-actions/multi-platform/ +#SECRETS: DOCKERHUB_USERNAME || DOCKERHUB_TOKEN +#URL: https://hub.docker.com/r/azathothas/ +#For: https://github.com/Azathothas/Toolpacks-Extras +#------------------------------------------------------------------------------------# +on: + #push: + workflow_dispatch: + schedule: + - cron: "15 0 * * *" #06:00 AM everyday +defaults: + run: + shell: bash + working-directory: /tmp +#------------------------------------------------------------------------------------# +jobs: + build-push-appbundler-alpine: + name: Push (AppBundler-Alpine) --> Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: main + filter: "blob:none" + + #- name: Debloat Runner + # run: | + # #Presets + # set +x ; set +e + # #--------------# + # bash <(curl -qfsSL "https://pub.ajam.dev/repos/Azathothas/Arsenal/misc/Github/Runners/Ubuntu/debloat.sh") + # continue-on-error: true + + - name: Setup Env + run: | + #Presets + set +x ; set +e + #--------------# + #Docker Tags + DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG" + echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}" + #Copy dockerfiles + mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES" + cp "${GITHUB_WORKSPACE}/main/.github/scripts/appbundles_alpine.Dockerfile" "/tmp/DOCKERFILES/appbundler-alpine.Dockerfile" + continue-on-error: true + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + continue-on-error: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + continue-on-error: true + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: "${{ secrets.DOCKERHUB_USERNAME }}" + password: "${{ secrets.DOCKERHUB_TOKEN }}" + continue-on-error: true + + #https://hub.docker.com/r/azathothas/appbundler-alpine + - name: Docker Build and Push (appbundler-alpine) + uses: docker/build-push-action@v6 + with: + context: /tmp/DOCKERFILES/ + file: "/tmp/DOCKERFILES/appbundler-alpine.dockerfile" + platforms: "linux/amd64,linux/arm64" + tags: | + azathothas/appbundler-alpine:latest + azathothas/appbundler-alpine:${{ env.DOCKER_TAG }} + push: true + continue-on-error: true +#------------------------------------------------------------------------------------# \ No newline at end of file