Publish Chrome #33
Workflow file for this run
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
name: Publish Chrome | |
on: | |
workflow_dispatch: | |
inputs: | |
chrome_version: | |
description: "Version of Chrome to build" | |
required: true | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install the Linode CLI | |
uses: linode/action-linode-cli@v1 | |
with: | |
token: ${{ secrets.LINODE_PAT }} | |
- name: Create Builder | |
id: create_builder | |
run: | | |
builder_info="$(linode-cli linodes create \ | |
--region us-west \ | |
--type g6-dedicated-4 \ | |
--authorized_keys '${{ secrets.LINODE_SSH_PUBLIC_KEY }}' \ | |
--image linode/ubuntu22.04 \ | |
--label chrome-builder-testing \ | |
--root_pass '${{ secrets.LINODE_ROOT_PASS }}' \ | |
--json)" | |
builder_id="$(echo $builder_info | jq -r '.[0].id')" | |
builder_ip="$(echo $builder_info | jq -r '.[0].ipv4[0]')" | |
echo "builder_id: $builder_id" | |
echo "builder_ip: $builder_ip" | |
echo "builder_id=$builder_id" >> $GITHUB_OUTPUT | |
echo "builder_ip=$builder_ip" >> $GITHUB_OUTPUT | |
env: | |
LINODE_CLI_TOKEN: ${{ secrets.LINODE_PAT }} | |
- name: Wait for Builder | |
run: | | |
status="provisioning" | |
while [ "$status" == "provisioning" ] || [ "$status" == "booting" ]; do \ | |
sleep 5; \ | |
status=$(linode-cli linodes view ${{ steps.create_builder.outputs.builder_id }} --json | jq -r '.[0].status'); \ | |
echo "Builder status: $status"; \ | |
done | |
env: | |
LINODE_CLI_TOKEN: ${{ secrets.LINODE_PAT }} | |
# - name: Write SSH keys | |
# run: | | |
# mkdir ~/.ssh | |
# chmod 700 ~/.ssh | |
# echo "${{ secrets.LINODE_SSH_PUBLIC_KEY }}" > ~/.ssh/linode_ed25519.pub | |
# chmod 600 ~/.ssh/linode_ed25519.pub | |
# echo "${{ secrets.LINODE_SSH_PRIVATE_KEY }}" > ~/.ssh/linode_ed25519 | |
# chmod 600 ~/.ssh/linode_ed25519 | |
# ssh-keyscan -H "${{ inputs.builder_ip }}" > ~/.ssh/known_hosts | |
# - name: Setup | |
# run: | | |
# ssh -i ~/.ssh/linode_ed25519 \ | |
# -o PasswordAuthentication=no \ | |
# -t root@${{ inputs.builder_ip }} \ | |
# 'bash -s' < ./build/chrome/scripts/setup.sh | |
# | |
# - name: Amd64 | |
# run: | | |
# ssh -i ~/.ssh/linode_ed25519 \ | |
# -o PasswordAuthentication=no \ | |
# -t chrome@${{ inputs.builder_ip }} \ | |
# 'bash -s ${{ inputs.chrome_version }}' < ./build/chrome/scripts/amd64.sh | |
# - name: Arm64 | |
# run: | | |
# ssh -i ~/.ssh/linode_ed25519 \ | |
# -o PasswordAuthentication=no \ | |
# -o ServerAliveInterval=60 \ | |
# -t chrome@${{ inputs.builder_ip }} \ | |
# 'bash -s ${{ inputs.chrome_version }}' < ./build/chrome/scripts/arm64.sh | |
# | |
# - name: Download artifacts | |
# run: | | |
# ssh -i ~/.ssh/linode_ed25519 \ | |
# -o PasswordAuthentication=no \ | |
# -t chrome@${{ inputs.builder_ip }} \ | |
# 'zip -r output.zip ./output' | |
# scp -i ~/.ssh/linode_ed25519 \ | |
# -o PasswordAuthentication=no \ | |
# chrome@${{ inputs.builder_ip }}:/home/chrome/output.zip \ | |
# ${{ github.workspace }}/build/chrome/output.zip | |
# unzip ${{ github.workspace }}/build/chrome/output.zip -d ${{ github.workspace }}/build/chrome/output | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v3 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# | |
# - name: Build and push | |
# uses: docker/build-push-action@v5 | |
# with: | |
# context: . | |
# file: ./build/chrome/Dockerfile | |
# push: true | |
# platforms: linux/amd64,linux/arm64 | |
# tags: test | |
- name: Delete Linode | |
if: always() | |
run: linode-cli linodes delete ${{ steps.create_builder.outputs.builder_id }} | |
env: | |
LINODE_CLI_TOKEN: ${{ secrets.LINODE_PAT }} |