This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image - Ubuntu | |
on: | |
push: | |
branches: | |
- main | |
- docker | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Perform the setup to grant access to USB devices | |
- name: Setup USB device access | |
run: | | |
# Determine the major number of your USB device | |
MAJOR=$(ls -l /dev/ttyUSB* | awk '{print $5}') | |
# Set permissions in the cgroup devices.allow file | |
echo "c $MAJOR:* rwm" > /sys/fs/cgroup/devices/docker/$(docker ps -q --filter ancestor=tagyoureit/nodejs-poolcontroller:latest)/devices.allow | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Linux Docker image (x86_64) | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./.docker/Dockerfile.linux | |
push: true | |
tags: | | |
tagyoureit/nodejs-poolcontroller:latest | |
# - name: Build and push ARMv7 Docker image | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: . | |
# file: ./.docker/Dockerfile.armv7 # Adjust the path to your ARMv7 Dockerfile | |
# push: true | |
# tags: | | |
# tagyoureit/nodejs-poolcontroller-armv7:latest | |
# - name: Build and push ARMv6 Docker image | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: . | |
# file: ./.docker/Dockerfile.armv6 # Adjust the path to your ARMv6 Dockerfile | |
# push: true | |
# tags: | | |
# tagyoureit/nodejs-poolcontroller-armv6:latest | |
# # Example of how to run docker-compose with the working directory specified | |
- name: Run Docker Compose | |
run: docker-compose up -d | |
working-directory: .docker # Specify the working directory here |