From 1588257f0652c9cf998475a127b2ec50786cd8e8 Mon Sep 17 00:00:00 2001 From: "Buster \"Silver Eagle\" Neece" Date: Thu, 18 Nov 2021 12:33:28 -0600 Subject: [PATCH] Consolidate and optimize steps. --- .github/workflows/default.yml | 63 +++-------------------------------- 1 file changed, 5 insertions(+), 58 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 0dc62cf29..8203170e2 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -21,7 +21,7 @@ on: jobs: build: - name: Build and Test + name: Build, Test and Publish runs-on: ubuntu-latest env: APPLICATION_ENV: testing @@ -118,7 +118,6 @@ jobs: load: true tags: ghcr.io/azuracast/web:latest cache-from: type=registry,ref=ghcr.io/azuracast/web:buildcache - outputs: type=docker,dest=/tmp/azuracast_web.tar - name: Set up functional test environment. run: | @@ -144,69 +143,16 @@ jobs: docker-compose logs cat tests/_output/* - - name: Upload built static assets and translations - uses: actions/upload-artifact@v2 - if: github.event_name == 'push' || github.event_name == 'schedule' - with: - name: assets - if-no-files-found: error - path: | - resources/locale/compiled - resources/locale/translations.json - web/static/dist - web/static/webpack_dist - web/static/webpack.json - web/static/assets.json - web/static/api/openapi.yml - - - name: Upload Docker image as artifact - uses: actions/upload-artifact@v2 - if: github.event_name == 'push' || github.event_name == 'schedule' - with: - name: myimage - path: /tmp/azuracast_web.tar - - publish: - name: Publish - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'push' || github.event_name == 'schedule' - steps: - - uses: actions/checkout@master - - - name: Reduce Git repository size. - run: | - git gc --prune=now --aggressive - - - name: Download built static assets from previous step - uses: actions/download-artifact@v2 - with: - name: assets - - # - name : Set up QEMU - # uses : docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Download artifact from previous step - uses: actions/download-artifact@v2 - with: - name: myimage - path: /tmp - - name: Load image from previous step - run: | - docker load --input /tmp/azuracast_web.tar - docker image ls -a - - name: Login to DockerHub uses: docker/login-action@v1 + if: github.event_name == 'push' || github.event_name == 'schedule' with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 + if: github.event_name == 'push' || github.event_name == 'schedule' with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -215,6 +161,7 @@ jobs: - name: Build Docker Metadata id: meta uses: crazy-max/ghaction-docker-meta@v2 + if: github.event_name == 'push' || github.event_name == 'schedule' with: images: | azuracast/azuracast_web_v2 @@ -226,10 +173,10 @@ jobs: - name: Publish Web Image uses: docker/build-push-action@master + if: github.event_name == 'push' || github.event_name == 'schedule' with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=ghcr.io/azuracast/web:latest cache-to: type=registry,ref=ghcr.io/azuracast/web:buildcache,mode=max