File tree Expand file tree Collapse file tree 2 files changed +89
-0
lines changed
Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Container Img Weekly Build and Release
2+
3+ on :
4+ schedule :
5+ # This will run every week at 00:00 UTC on Monday
6+ - cron : " 0 0 * * 1"
7+ workflow_dispatch :
8+
9+ jobs :
10+ build-and-push-docker-image :
11+ name : Container Img Weekly Build and Release
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout Code
15+ uses : actions/checkout@v4
16+
17+ - name : Set up QEMU
18+ uses : docker/setup-qemu-action@v3
19+
20+ - name : Set up Docker Buildx
21+ id : buildx
22+ uses : docker/setup-buildx-action@v3
23+
24+ - name : Login to Docker Hub
25+ if : github.event_name != 'pull_request'
26+ uses : docker/login-action@v3
27+ with :
28+ username : ${{ secrets.DOCKERHUB_USERNAME }}
29+ password : ${{ secrets.DOCKERHUB_TOKEN }}
30+
31+ - name : Get the current date
32+ id : current_date
33+ run : echo "name=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
34+
35+ - name : Build image and push to Docker Hub
36+ uses : docker/build-push-action@v6
37+ with :
38+ context : .
39+ file : ./infrastructure/base-container-img
40+ platforms : linux/amd64,linux/arm64
41+ tags : |
42+ riscvintl/udb:${{ github.sha }}
43+ riscvintl/udb:latest
44+ push : ${{ github.event_name != 'pull_request' }}
45+
46+ - name : Set short SHA
47+ run : echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
48+
49+ - name : Get current date
50+ run : echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
Original file line number Diff line number Diff line change 1+ FROM ubuntu:24.04
2+
3+ ENV DEBIAN_FRONTEND=noninteractive
4+ ENV DEVCONTAINER_ENV=1
5+ ENV BUNDLE_PATH=/usr/local/bundle
6+ ENV BUNDLE_APP_CONFIG=/usr/local/bundle
7+
8+ # Set working directory
9+ WORKDIR /workspace
10+
11+ # Install dependencies
12+ RUN apt-get update && \
13+ apt-get install -y --no-install-recommends \
14+ git \
15+ gh \
16+ less \
17+ python3 \
18+ python3.12-venv \
19+ python3-pip \
20+ build-essential \
21+ ruby \
22+ ruby-dev \
23+ bundler \
24+ nodejs \
25+ npm \
26+ ditaa && \
27+ apt-get clean && \
28+ rm -rf /var/lib/apt/lists/*
29+
30+ # Copy and install Ruby dependencies
31+ COPY Gemfile Gemfile.lock ./
32+ RUN bundle install
33+
34+ # Copy and install Node.js dependencies
35+ COPY package.json package-lock.json ./
36+ RUN npm ci
37+
38+ # Final working directory
39+ WORKDIR /workspace
You can’t perform that action at this time.
0 commit comments