Skip to content

Commit

Permalink
Adding proper extension to the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hernandez committed Dec 6, 2023
1 parent 7369586 commit b894942
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-develop-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and push image from develop
on:
pull_request:
types: [ closed ]
branches:
- develop
push:
branches:
- feature/build-claasp-image-workflow

jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
file: ./docker/Dockerfile
push: true
load: true
tags: tiicrc/claasp-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
env:
DOCKER_USERNAME: devopscrc
DOCKER_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 comments on commit b894942

Please sign in to comment.