Skip to content

Updated the version of actions/checkout. #89

Updated the version of actions/checkout.

Updated the version of actions/checkout. #89

Workflow file for this run

---
name: latest
on:
pull_request:
push:
branches:
- master
# schedule:
# - cron: '50 3 * * 6'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out git repository.
uses: actions/checkout@v4
- name: Build the docker container
run: docker build -t docker-test .
- name: Test the docker container runs.
run: docker run --name docker-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host docker-test
- name: Check ansible is availble inside the container.
run: docker exec --tty docker-container env TERM=xterm ansible --version
# If on master branch, push to Docker Hub.
push:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
# For further details on the below see;
# https://github.com/docker/build-push-action#multi-platform-image &
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#contexts
steps:
- name: Check out git repository.
uses: actions/checkout@v4
- name: Setup QEMU.
uses: docker/setup-qemu-action@v1
- name: Setup buildx.
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub.
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME}}
password: ${{ secrets.DOCKER_HUB_PASSWORD}}
- name: Build and push.
uses: docker/build-push-action@v2
with:
context: ./
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ github.repository }}:latest