Skip to content

Commit

Permalink
Merge pull request #2 from antobinary/ci
Browse files Browse the repository at this point in the history
added ci steps to build and push docker image
  • Loading branch information
antobinary authored Oct 19, 2023
2 parents 31d29d5 + 3c23222 commit 636bf70
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.build.push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build And Push to Dockerhub
on:
push:
tags:
- '*'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- '**/*.md'
permissions:
contents: read
jobs:
main:
name: Build Docker Image
env:
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
runs-on: ubuntu-latest

steps:
- name: Checkout
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: actions/checkout@v3

- name: Set up Docker Buildx
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get current date
id: date
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
shell: bash
run: echo "time=$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT

- name: Build and Push branch
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
uses: docker/build-push-action@v3
with:
push: true
tags: "bigbluebutton/bbb-libreoffice:${{ github.ref_name }}--${{ steps.date.outputs.time }}"
context: .
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline

0 comments on commit 636bf70

Please sign in to comment.