|
| 1 | +# This file is automatically generated |
| 2 | + |
| 3 | +name: Auto Builder CI |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + repository_dispatch: |
| 8 | + release: |
| 9 | + types: |
| 10 | + - released |
| 11 | + |
| 12 | +jobs: |
| 13 | + alpine-latest: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v2 |
| 18 | + with: |
| 19 | + ref: main |
| 20 | + fetch-depth: 0 |
| 21 | + |
| 22 | + - name: Set up QEMU |
| 23 | + uses: docker/setup-qemu-action@v1 |
| 24 | + |
| 25 | + - name: Set up Docker Buildx |
| 26 | + uses: docker/setup-buildx-action@v1 |
| 27 | + id: buildx |
| 28 | + |
| 29 | + - name: Docker Login |
| 30 | + uses: docker/login-action@v1 |
| 31 | + with: |
| 32 | + username: vcxpz |
| 33 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 34 | + |
| 35 | + - name: Github Login |
| 36 | + run: | |
| 37 | + git config --global user.email "github-actions@github.com" |
| 38 | + git config --global user.name "github-actions" |
| 39 | +
|
| 40 | + - name: Build the Docker Image Locally (amd64) |
| 41 | + run: | |
| 42 | + docker buildx build \ |
| 43 | + --platform=amd64 \ |
| 44 | + --output "type=docker" \ |
| 45 | + --build-arg BUILD_DATE="$(date +%Y-%m-%d)" \ |
| 46 | + --build-arg VERSION=$(curl -sL "https://api.github.com/repos/hydazz/docker-amp/releases/latest" | jq -r '.tag_name') \ |
| 47 | + --tag vcxpz/ci-build:ci-build \ |
| 48 | + --file Dockerfile . |
| 49 | +
|
| 50 | + - name: Build and Push the Docker Image |
| 51 | + run: | |
| 52 | + docker buildx build \ |
| 53 | + --platform=linux/amd64,linux/arm64 \ |
| 54 | + --output "type=image,push=true" \ |
| 55 | + --build-arg BUILD_DATE="$(date +%Y-%m-%d)" \ |
| 56 | + --build-arg VERSION=$(curl -sL "https://api.github.com/repos/hydazz/docker-amp/releases/latest" | jq -r '.tag_name') \ |
| 57 | + --tag vcxpz/amp:$(curl -sL "https://api.github.com/repos/hydazz/docker-amp/releases/latest" | jq -r '.tag_name') \ |
| 58 | + --tag vcxpz/amp:latest \ |
| 59 | + --file Dockerfile . |
| 60 | +
|
| 61 | + - name: Get New Package Versions From Image |
| 62 | + run: | |
| 63 | + docker run --rm --entrypoint /bin/sh -v ${PWD}:/tmp vcxpz/ci-build:ci-build -c '\ |
| 64 | + curl -sSL https://raw.githubusercontent.com/hydazz/docker-utils/main/scripts/package_versioner.sh | bash' |
| 65 | +
|
| 66 | + - name: Commit and Push Changes to Github |
| 67 | + run: | |
| 68 | + git add -A |
| 69 | + git commit -m "Bot Updating Files" || true |
| 70 | + git push || true |
| 71 | +
|
| 72 | + - name: Sync README.md With Docker Hub |
| 73 | + uses: peter-evans/dockerhub-description@v2 |
| 74 | + with: |
| 75 | + username: vcxpz |
| 76 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 77 | + repository: vcxpz/amp |
| 78 | + |
0 commit comments