Skip to content

Commit 932a06d

Browse files
author
user.name
committed
test docker build
1 parent ff4cc7f commit 932a06d

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

.github/workflows/demo.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
name: GitHub Actions Demo
2-
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
1+
name: Docker Container Build
2+
run-name: ${{ github.actor }} triggered docker build
33
on: [push]
44
jobs:
5-
Explore-GitHub-Actions:
5+
docker-build:
66
runs-on: ubuntu-latest
77
steps:
8-
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
9-
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
10-
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
11-
- name: Check out repository code
8+
- name: Checkout
129
uses: actions/checkout@v4
13-
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
14-
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
10+
11+
- name: Set up Docker Buildx
12+
uses: docker/setup-buildx-action@v3
13+
14+
- name: Build and Save Docker Image
15+
uses: docker/build-push-action@v5
16+
with:
17+
context: .
18+
file: Dockerfile
19+
push: false
20+
tags: my-image:latest
21+
1522
- name: List files in the repository
1623
run: |
1724
ls ${{ github.workspace }}
18-
- run: echo "🍏 This job's status is ${{ job.status }}."
25+
docker images -a
26+
27+
- run: echo "Job's status is ${{ job.status }}."
28+
1929

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ubuntu:18.04
2+
3+
RUN apt-get update && \
4+
apt-get install -y redis-server && \
5+
apt-get clean
6+
7+
EXPOSE 6379
8+
9+
CMD ["redis-server", "--protected-mode no"]
10+

0 commit comments

Comments
 (0)