Skip to content

build(deps): bump debian in /src #273

build(deps): bump debian in /src

build(deps): bump debian in /src #273

name: test-build-release
on: push
env:
IMAGE_TAG: ${{ github.sha }}
IMAGE: ${{ github.repository }}
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install bats
run: sudo apt-get -y install bats > /dev/null
- name: Run CI script
run: ./test/run.bats
release:
name: Create release
needs: tests
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: dump-version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and push Docker image
run: |
DOCKERHUB_USERNAME=`echo "${IMAGE}" | awk -F"/" '{print $1}'`
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u $DOCKERHUB_USERNAME --password-stdin
# docker build
docker build -t ${IMAGE}:${{ steps.dump-version.outputs.new_tag }} . -f src/Dockerfile
# docker create latest tag
docker tag ${IMAGE}:${{ steps.dump-version.outputs.new_tag }} ${IMAGE}:latest
# docker push images
docker push --all-tags ${IMAGE}