add Dockerfile and use that in daily-collect
This commit is contained in:
parent
5a9d51a7d5
commit
6a614c8c9b
2 changed files with 42 additions and 28 deletions
32
.forgejo/workflows/Dockerfile
Normal file
32
.forgejo/workflows/Dockerfile
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
# Avoid prompts from apt
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Install essential tools
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
wget \
|
||||||
|
openssh-client \
|
||||||
|
ca-certificates \
|
||||||
|
build-essential \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Setup Rust
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
# Verify installations
|
||||||
|
RUN node --version && \
|
||||||
|
npm --version && \
|
||||||
|
rustc --version && \
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
WORKDIR /github/workspace
|
||||||
|
|
||||||
|
# Default command (can be overridden)
|
||||||
|
CMD ["/bin/bash"]
|
|
@ -11,46 +11,28 @@ jobs:
|
||||||
update-feed:
|
update-feed:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ubuntu:22.04
|
# Reference the Dockerfile in your repository
|
||||||
steps:
|
dockerfile: .forgejo/actions/Dockerfile
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update -y && apt-get install -y \
|
|
||||||
git \
|
|
||||||
openssh-client \
|
|
||||||
curl \
|
|
||||||
ca-certificates \
|
|
||||||
npm \
|
|
||||||
nodejs
|
|
||||||
|
|
||||||
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: bpmcdevitt/github_poc_collector
|
repository: bpmcdevitt/github_poc_collector
|
||||||
# Use the appropriate ref if you want a specific branch/commit
|
|
||||||
# ref: main
|
|
||||||
# If you need to use SSH
|
|
||||||
ssh-key: ${{ secrets.TOKEN_NAME }}
|
ssh-key: ${{ secrets.TOKEN_NAME }}
|
||||||
# If you have specific known hosts
|
|
||||||
ssh-known-hosts: git.mcdevitt.tech
|
ssh-known-hosts: git.mcdevitt.tech
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup SSH
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.TOKEN_NAME }}
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
mkdir -p ~/.ssh
|
||||||
source "$HOME/.cargo/env"
|
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
||||||
rustup default stable
|
chmod 600 ~/.ssh/id_rsa
|
||||||
rustc --version
|
ssh-keyscan git.mcdevitt.tech >> ~/.ssh/known_hosts
|
||||||
cargo --version
|
|
||||||
|
|
||||||
- name: Cache Cargo dependencies
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.cargo/registry
|
|
||||||
mkdir -p ~/.cargo/git
|
|
||||||
mkdir -p target
|
|
||||||
|
|
||||||
- name: Run recent feed update
|
- name: Run recent feed update
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
|
||||||
cargo run -- --feed recent
|
cargo run -- --feed recent
|
||||||
|
|
||||||
- name: Commit and push results
|
- name: Commit and push results
|
||||||
|
|
Loading…
Add table
Reference in a new issue