Merge pull request #133 from SiziweLupondo/Docker_workflow #1
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: Build Docker Image-ubuntu | |
on: | |
push: | |
branches: | |
- develop | |
- Docker_workflow | |
pull_request: | |
branches: | |
- develop | |
- Docker_workflow | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build Docker image | |
run: | | |
ls | |
pushd Docker | |
docker build -f Dockerfile.flint.ubuntu.18.04 -t moja/flint:ubuntu-18.04 . | |
popd | |
- name: Save Docker image as artifact | |
run: | | |
docker save moja/flint:ubuntu-18.04 | gzip > flint_docker_image.tar.gz | |
shell: bash | |
- name: Upload Docker image artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: docker-image | |
path: flint_docker_image.tar.gz |