Skip to content

Commit

Permalink
ci: use workflow inside cafe-common
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w committed Dec 31, 2022
1 parent c45159e commit 60ea0fa
Showing 1 changed file with 9 additions and 54 deletions.
63 changes: 9 additions & 54 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,19 @@
# This is a basic workflow to help you get started with Actions
name: reusing workflow

name: CI to Docker Hub

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Install dependencies
run: sudo apt-get install python3-github

- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

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

- name: install docker-build
run: |
curl -Ls -o install-dockerbuild https://github.com/cafe-desktop/cafe-dev-scripts/raw/master/travis/build/install-dockerbuild.sh
curl -Ls -o build-push https://github.com/cafe-desktop/cafe-dev-scripts/raw/master/travis/build/build-push.sh
chmod +x install-dockerbuild build-push
./install-dockerbuild
- name: Build and push
env:
TRAVIS_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
./build-push
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' }}
with:
branch: gh-pages
folder: html-report
single-commit: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
docker:
uses: cafe-desktop/cafe-common/.github/workflows/main.yml@master
with:
image_name: cafe-calc
tag: $GITHUB_RUN_NUMBER
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

0 comments on commit 60ea0fa

Please sign in to comment.