-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from SiziweLupondo/Docker_workflow
Docker workflow
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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 |