From 66006eea99213b9047020d1e0b5cac27e67c3cfc Mon Sep 17 00:00:00 2001 From: Phoenix / Hotaru Date: Mon, 7 Mar 2022 20:22:25 +0000 Subject: [PATCH] Update Builder --- .github/workflows/release.yml | 69 +++++++++++++++++++---------------- docker-compose.yml | 14 +++++++ 2 files changed, 51 insertions(+), 32 deletions(-) create mode 100644 docker-compose.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 117225d..68f0bb7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,55 +11,60 @@ env: IMAGE_NAME: blog jobs: - deploy: - runs-on: ubuntu-18.04 - strategy: - matrix: - CPU_ARCH: - - arm64 - - x86_64 + Build_x86: + runs-on: ubuntu-latest # If running with act, Uncomment below - container: phaze9/action-runner + # container: phaze9/action-runner + env: + DOCKER_CONFIG: $HOME/.docker steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: '0.83.1' - extended: true - - - name: Build - run: cd src && hugo --minify --destination build/ - - - name: Setup Docker + - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v1 - - - name: Login to ghcr.io - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - x64 + - name: Login to ghcr.io + uses: docker/login-action@v1 + with: + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ env.IMAGE_OWNER }} + password: ${{ secrets.TOKEN }} + + - name: Build and push id: docker_build_x64 uses: docker/build-push-action@v2 - if: ${{ matrix.CPU_ARCH == 'x86_64'}} with: push: true platforms: linux/amd64 labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:x64-latest + + Build_ARM64: + runs-on: [self-hosted, linux, ARM64] + # If running with act, Uncomment below + # container: phaze9/action-runner + env: + DOCKER_CONFIG: $HOME/.docker + steps: + - uses: actions/checkout@v2 - - name: Build and push - arm64 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to ghcr.io + uses: docker/login-action@v1 + with: + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ env.IMAGE_OWNER }} + password: ${{ secrets.TOKEN }} + + - name: Build and push id: docker_build_arm64 uses: docker/build-push-action@v2 - if: ${{ matrix.CPU_ARCH == 'arm64'}} with: push: true platforms: linux/arm64 labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm-latest \ No newline at end of file + tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm64-latest \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..547ac96 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3" + +services: + blog.fluttershub.com: + image: ghcr.io/fluttershub/blog:arm64-latest + restart: always + networks: + - external + container_name: blog.fluttershub.com + labels: + - "traefik.enable=true" +networks: + external: + external: true \ No newline at end of file