samba-container build and test #80
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: samba-container build and test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
# Allow for manually running | |
workflow_dispatch: | |
# Run at 02:42 UTC every Saturday | |
schedule: | |
- cron: '42 2 * * 6' | |
jobs: | |
build-test-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
env: | |
REPO: crops/samba | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
GHCR_USERNAME: ${{ github.actor }} | |
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
# Install packages on the runner | |
- name: install smbclient | |
run: | | |
sudo apt-get update | |
sudo apt-get install smbclient | |
# Build the image | |
- name: build | |
run: docker build -t ${REPO} . | |
# Test the image | |
- name: test | |
run: | | |
pip install pytest>3.0 | |
sudo apt-get install -y cifs-utils | |
pytest -v | |
# Deploy the images | |
- name: deploy | |
run: bash deploy.sh |