forked from ghuntley/loom
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.57 KB
/
Copy pathampcode-image.yml
File metadata and controls
63 lines (50 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright (c) 2025 Geoffrey Huntley <ghuntley@ghuntley.com>. All rights reserved.
# SPDX-License-Identifier: Proprietary
name: "build and publish: ampcode"
on:
schedule:
# Run every 6 hours
- cron: '0 */6 * * *'
workflow_dispatch: # Allow manual triggers
jobs:
build-and-push:
name: Build & Push Ampcode Image
runs-on: namespace-profile-cached-amd64
permissions:
contents: read
packages: write
steps:
- name: Create Dockerfile
run: |
cat > Dockerfile << 'EOF'
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
git \
sudo \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash ubuntu && \
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER ubuntu
WORKDIR /home/ubuntu
RUN curl -fsSL https://ampcode.com/install.sh | bash
ENV PATH="/home/ubuntu/.amp/bin:${PATH}"
CMD ["bash"]
EOF
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/ghuntley/loom/ampcode:latest
cache-from: type=gha
cache-to: type=gha,mode=max