feat: dockerfile publishing on release-10 branch
This commit is contained in:
parent
95df06250e
commit
4a27be33f5
4 changed files with 86 additions and 44 deletions
60
.github/workflows/docker-build.yml
vendored
Normal file
60
.github/workflows/docker-build.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: Docker Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release-10.0
|
||||
|
||||
env:
|
||||
DOCKERHUB_SERVER_REPO: lamassu/lamassu-server
|
||||
DOCKERHUB_ADMIN_REPO: lamassu/lamassu-admin-server
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-updatetar
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-updatetar
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
target: l-s
|
||||
tags: ${{ env.DOCKERHUB_SERVER_REPO }}:latest
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
target: l-a-s
|
||||
tags: ${{ env.DOCKERHUB_ADMIN_REPO }}:latest
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
Loading…
Add table
Add a link
Reference in a new issue