Consolidate and optimize steps.
This commit is contained in:
parent
d107f1009c
commit
1588257f06
|
@ -21,7 +21,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and Test
|
name: Build, Test and Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
APPLICATION_ENV: testing
|
APPLICATION_ENV: testing
|
||||||
|
@ -118,7 +118,6 @@ jobs:
|
||||||
load: true
|
load: true
|
||||||
tags: ghcr.io/azuracast/web:latest
|
tags: ghcr.io/azuracast/web:latest
|
||||||
cache-from: type=registry,ref=ghcr.io/azuracast/web:buildcache
|
cache-from: type=registry,ref=ghcr.io/azuracast/web:buildcache
|
||||||
outputs: type=docker,dest=/tmp/azuracast_web.tar
|
|
||||||
|
|
||||||
- name: Set up functional test environment.
|
- name: Set up functional test environment.
|
||||||
run: |
|
run: |
|
||||||
|
@ -144,69 +143,16 @@ jobs:
|
||||||
docker-compose logs
|
docker-compose logs
|
||||||
cat tests/_output/*
|
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
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
|
@ -215,6 +161,7 @@ jobs:
|
||||||
- name: Build Docker Metadata
|
- name: Build Docker Metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: crazy-max/ghaction-docker-meta@v2
|
uses: crazy-max/ghaction-docker-meta@v2
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
azuracast/azuracast_web_v2
|
azuracast/azuracast_web_v2
|
||||||
|
@ -226,10 +173,10 @@ jobs:
|
||||||
|
|
||||||
- name: Publish Web Image
|
- name: Publish Web Image
|
||||||
uses: docker/build-push-action@master
|
uses: docker/build-push-action@master
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'schedule'
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
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
|
cache-to: type=registry,ref=ghcr.io/azuracast/web:buildcache,mode=max
|
||||||
|
|
Loading…
Reference in New Issue