Skip to content

ci: test deploy

ci: test deploy #137

Workflow file for this run

# This is a basic workflow to help you get started with Actions
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:
workflow_call:
inputs:
image_name:
required: true
type: string
tag:
type: string
secrets:
DOCKER_HUB_USERNAME:
required: true
DOCKER_HUB_ACCESS_TOKEN:
required: true
DOCKER_HUB_DISTRO:
required: false
GH_PAGES_DEPLOY:
required: false
# 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
env:
DEPLOYURL: 'JamesIves/github-pages-deploy-action@v4'
# 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@main
- name: Login to Docker Hub
uses: docker/login-action@v3
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }}
if: ${{ env.DOCKER_USER != '' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- 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 ${{ secrets.DOCKER_HUB_DISTRO }}
- name: Deploy
uses: ${{ env.DEPLOYURL }}
env:
GH_DEPLOY: ${{ secrets.GH_PAGES_DEPLOY }}
if: ${{ github.event_name == 'push' && env.GH_DEPLOY != 'false' }}
with:
branch: gh-pages
folder: html-report
single-commit: true
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}